Skip to content

Commit

Permalink
[Dropper] + finish Dropper UI binary tab page interface (only) #182 #181
Browse files Browse the repository at this point in the history


Signed-off-by: Gheorghita Mutu <gheorghitamutu@gmail.com>
  • Loading branch information
gheorghitamutu committed Apr 30, 2024
1 parent cc10b16 commit aacd9ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
6 changes: 6 additions & 0 deletions GenericPlugins/Dropper/include/DropperUI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ class DropperUI : public Window
Reference<RadioBox> computeForSelection;

Reference<TextField> binaryFilename;
Reference<TextField> includedCharset;
Reference<TextField> excludedCharset;

Reference<CheckBox> checkboxOpenDroppedFile;
Reference<CheckBox> checkboxOverwriteFile;
Reference<CheckBox> checkboxAppendToFile;

public:
DropperUI(Reference<GView::Object> object);
Expand Down
25 changes: 22 additions & 3 deletions GenericPlugins/Dropper/src/DropperUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ constexpr int32 RADIO_GROUP_COMPUTATION = 1;
constexpr int32 RADIO_ID_FILE = 1;
constexpr int32 RADIO_ID_SELECTION = 2;

constexpr int32 CHECKBOX_ID_OPEN_DROPPED_FILE = 1;
constexpr int32 CHECKBOX_ID_OVERWRITE_FILE = 2;
constexpr int32 CHECKBOX_ID_APPEND_TO_FILE = 3;

using namespace AppCUI::Controls;

namespace GView::GenericPlugins::Droppper
Expand All @@ -26,7 +30,7 @@ DropperUI::DropperUI(Reference<GView::Object> object) : Window("Dropper", "d:c,w
this->Exit(Dialogs::Result::Cancel);
}

this->tab = Factory::Tab::Create(this, "l:1,t:1,r:1,b:6", TabFlags::LeftTabs | TabFlags::TabsBar);
this->tab = Factory::Tab::Create(this, "l:1,t:1,r:1,b:6", TabFlags::TopTabs | TabFlags::TabsBar);
auto tpb = Factory::TabPage::Create(this->tab, BINARY_PAGE_NAME);
auto tpo = Factory::TabPage::Create(this->tab, OBJECTS_PAGE_NAME);
auto tps = Factory::TabPage::Create(this->tab, STRINGS_PAGE_NAME);
Expand All @@ -35,11 +39,26 @@ DropperUI::DropperUI(Reference<GView::Object> object) : Window("Dropper", "d:c,w
LocalUnicodeStringBuilder<1024> lusb;

/* init binary tab page area */

lusb.Set(object->GetName());
lusb.Add(".drop");

Factory::Label::Create(tpb, "Filename", "x:2%,y:1,w:13%");
this->binaryFilename = Factory::TextField::Create(tpb, lusb, "x:15%,y:1,w:83%");
Factory::Label::Create(tpb, "Description: drop selection(s) to a file (overwrite or append)", "x:2%,y:1,w:97%");

Factory::Label::Create(tpb, "Filename", "x:2%,y:3,w:13%");
this->binaryFilename = Factory::TextField::Create(tpb, lusb, "x:15%,y:3,w:84%");

Factory::Label::Create(tpb, "CharSet to include (a-z,\\x01-\\x05)", "x:2%,y:5,w:97%");
this->includedCharset = Factory::TextField::Create(tpb, "\\x00-\\xff", "x:2%,y:6,w:97%");

Factory::Label::Create(tpb, "CharSet to exclude (a-z,\\x01-\\x05)", "x:2%,y:8,w:97%");
this->excludedCharset = Factory::TextField::Create(tpb, "", "x:2%,y:9,w:97%");

this->checkboxOpenDroppedFile = Factory::CheckBox::Create(tpb, "Open &dropped file", "x:2%,y:11,w:96%", CHECKBOX_ID_OPEN_DROPPED_FILE);
this->checkboxOverwriteFile = Factory::CheckBox::Create(tpb, "Over&write file", "x:2%,y:13,w:96%", CHECKBOX_ID_OVERWRITE_FILE);
this->checkboxAppendToFile = Factory::CheckBox::Create(tpb, "&Append to file", "x:2%,y:15,w:96%", CHECKBOX_ID_APPEND_TO_FILE);

this->checkboxOverwriteFile->SetChecked(true);

/* end binary tab page area */

Expand Down

0 comments on commit aacd9ff

Please sign in to comment.