Skip to content

Commit

Permalink
jx_layout_editor: InputField: add monospace and hint configuration; c…
Browse files Browse the repository at this point in the history
…reate remaining boxes; bug fixes
  • Loading branch information
jafl committed Jan 26, 2024
1 parent 18594bd commit 32c65f1
Show file tree
Hide file tree
Showing 56 changed files with 1,618 additions and 432 deletions.
58 changes: 22 additions & 36 deletions libjfs/code/JXFSEditBindingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ JXFSEditBindingsDialog::BuildWindow()

auto* scrollbarSet =
jnew JXScrollbarSet(window,
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 490,230);
JXWidget::kHElastic, JXWidget::kVElastic, 0,0, 490,260);
assert( scrollbarSet != nullptr );

auto* addButton =
Expand All @@ -154,31 +154,26 @@ JXFSEditBindingsDialog::BuildWindow()
JXWidget::kFixedRight, JXWidget::kFixedTop, 500,90, 70,20);
assert( removeButton != nullptr );

itsUseDefaultCB =
jnew JXTextCheckbox(JGetString("itsUseDefaultCB::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 10,250, 190,20);

itsHelpButton =
jnew JXTextButton(JGetString("itsHelpButton::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 510,260, 50,20);
itsHelpButton->SetShortcuts(JGetString("itsHelpButton::shortcuts::JXFSEditBindingsDialog::JXLayout"));

auto* cmdHint2 =
jnew JXStaticText(JGetString("cmdHint2::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 140,270, 350,20);
cmdHint2->SetToLabel(false);
itsUseDefaultCB =
jnew JXTextCheckbox(JGetString("itsUseDefaultCB::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 10,280, 190,20);

itsDefShellCB =
jnew JXTextCheckbox(JGetString("itsDefShellCB::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 140,290, 90,20);
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 140,310, 90,20);

itsDefWindowCB =
jnew JXTextCheckbox(JGetString("itsDefWindowCB::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 240,290, 110,20);
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 240,310, 110,20);

itsDefSingleCB =
jnew JXTextCheckbox(JGetString("itsDefSingleCB::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 370,290, 120,20);
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 370,310, 120,20);

itsRevertButton =
jnew JXTextButton(JGetString("itsRevertButton::JXFSEditBindingsDialog::JXLayout"), window,
Expand All @@ -187,23 +182,18 @@ JXFSEditBindingsDialog::BuildWindow()

auto* shellCmdLabel =
jnew JXStaticText(JGetString("shellCmdLabel::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 70,330, 120,20);
shellCmdLabel->SetToLabel(false);

auto* windowCmdLabel =
jnew JXStaticText(JGetString("windowCmdLabel::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 70,350, 120,20);
windowCmdLabel->SetToLabel(false);
shellCmdLabel->SetToLabel(false);

itsSaveButton =
jnew JXTextButton(JGetString("itsSaveButton::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 510,360, 50,20);
itsSaveButton->SetShortcuts(JGetString("itsSaveButton::shortcuts::JXFSEditBindingsDialog::JXLayout"));

auto* cmdHint1 =
jnew JXStaticText(JGetString("cmdHint1::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedBottom, 130,370, 360,20);
cmdHint1->SetToLabel(false);
auto* windowCmdLabel =
jnew JXStaticText(JGetString("windowCmdLabel::JXFSEditBindingsDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedBottom, 70,370, 120,20);
windowCmdLabel->SetToLabel(false);

itsAutoShellCB =
jnew JXTextCheckbox(JGetString("itsAutoShellCB::JXFSEditBindingsDialog::JXLayout"), window,
Expand All @@ -216,7 +206,7 @@ JXFSEditBindingsDialog::BuildWindow()

itsTable =
jnew JXFSBindingTable(itsBindingList, addButton, removeButton, duplicateButton, scrollbarSet, scrollbarSet->GetScrollEnclosure(),
JXWidget::kHElastic, JXWidget::kVElastic, 0,20, 490,210);
JXWidget::kHElastic, JXWidget::kVElastic, 0,20, 490,240);

auto* header =
jnew JXColHeaderWidget(itsTable, scrollbarSet, scrollbarSet->GetScrollEnclosure(),
Expand All @@ -225,18 +215,24 @@ JXFSEditBindingsDialog::BuildWindow()

itsDefCmd =
jnew JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 200,250, 290,20);
JXWidget::kHElastic, JXWidget::kFixedBottom, 200,280, 290,20);
itsDefCmd->SetIsRequired();
itsDefCmd->SetFont(JFontManager::GetDefaultMonospaceFont());
itsDefCmd->SetHint(JGetString("itsDefCmd::JXFSEditBindingsDialog::JXLayout"));

itsShellCmd =
jnew JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 190,330, 300,20);
JXWidget::kHElastic, JXWidget::kFixedBottom, 190,350, 300,20);
itsShellCmd->SetIsRequired();
itsShellCmd->SetFont(JFontManager::GetDefaultMonospaceFont());
itsShellCmd->SetHint(JGetString("itsShellCmd::JXFSEditBindingsDialog::JXLayout"));

itsWindowCmd =
jnew JXInputField(window,
JXWidget::kHElastic, JXWidget::kFixedBottom, 190,350, 300,20);
JXWidget::kHElastic, JXWidget::kFixedBottom, 190,370, 300,20);
itsWindowCmd->SetIsRequired();
itsWindowCmd->SetFont(JFontManager::GetDefaultMonospaceFont());
itsWindowCmd->SetHint(JGetString("itsWindowCmd::JXFSEditBindingsDialog::JXLayout"));

// end JXLayout

Expand All @@ -248,16 +244,6 @@ JXFSEditBindingsDialog::BuildWindow()
SaveNeeded();
}));

// other information

const JFont& font = JFontManager::GetDefaultMonospaceFont();
itsDefCmd->SetFont(font);
itsShellCmd->SetFont(font);
itsWindowCmd->SetFont(font);

cmdHint1->SetFontSize(JFontManager::GetDefaultFontSize()-2);
cmdHint2->SetFontSize(JFontManager::GetDefaultFontSize()-2);

Revert(false);

ListenTo(itsSaveButton, std::function([this](const JXButton::Pushed&)
Expand Down
2 changes: 1 addition & 1 deletion libjfs/code/JXFSEditBindingsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class JXFSEditBindingsDialog : public JXWindowDirector

// begin JXLayout

JXTextCheckbox* itsUseDefaultCB;
JXTextButton* itsHelpButton;
JXTextCheckbox* itsUseDefaultCB;
JXTextCheckbox* itsDefShellCB;
JXTextCheckbox* itsDefWindowCB;
JXTextCheckbox* itsDefSingleCB;
Expand Down
115 changes: 45 additions & 70 deletions libjfs/code/JXFSEditBindingsDialog.jxl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jx_layout_editor 5
jx_layout_editor 6
580
430
"JXLayout"
Expand All @@ -12,7 +12,7 @@ jx_layout_editor 5
"ScrollbarSet"
2
2
0 0 230 490
0 0 260 490
"scrollbarSet"
0
0
Expand All @@ -38,7 +38,7 @@ jx_layout_editor 5
"CustomWidget"
2
2
20 0 215 475
20 0 245 475
"itsTable"
1
0
Expand Down Expand Up @@ -87,12 +87,25 @@ jx_layout_editor 5
"Remove"
""

1
0
"TextButton"
1
1
260 510 280 560
"itsHelpButton"
1
0
0
"Help"
"F1"

1
0
"TextCheckbox"
0
1
250 10 270 200
280 10 300 200
"itsUseDefaultCB"
1
0
Expand All @@ -105,7 +118,7 @@ jx_layout_editor 5
"InputField"
2
1
250 200 270 490
280 200 300 490
"itsDefCmd"
1
1
Expand All @@ -118,43 +131,16 @@ jx_layout_editor 5
""
0
0

1
0
"TextButton"
1
1
260 510 280 560
"itsHelpButton"
1
0
0
"Help"
"F1"

1
0
"StaticText"
1
1
270 140 290 490
"cmdHint2"
0
0
0
"(use $q in place of quoted file name, $u in place of unquoted file name)"
1
0
0
0
0
"$q for quoted file name
$u for unquoted file name"

1
0
"TextCheckbox"
0
1
290 140 310 230
310 140 330 230
"itsDefShellCB"
1
0
Expand All @@ -167,7 +153,7 @@ jx_layout_editor 5
"TextCheckbox"
0
1
290 240 310 350
310 240 330 350
"itsDefWindowCB"
1
0
Expand All @@ -180,7 +166,7 @@ jx_layout_editor 5
"TextCheckbox"
0
1
290 370 310 490
310 370 330 490
"itsDefSingleCB"
1
0
Expand All @@ -206,7 +192,7 @@ jx_layout_editor 5
"StaticText"
0
1
330 70 350 190
350 70 370 190
"shellCmdLabel"
0
0
Expand All @@ -223,7 +209,7 @@ jx_layout_editor 5
"InputField"
2
1
330 190 350 490
350 190 370 490
"itsShellCmd"
1
2
Expand All @@ -236,13 +222,29 @@ jx_layout_editor 5
""
0
0
1
"$q for quoted command
+$u for unquoted command"

1
0
"TextButton"
1
1
360 510 380 560
"itsSaveButton"
1
0
0
"Save"
"#S"

1
0
"StaticText"
0
1
350 70 370 190
370 70 390 190
"windowCmdLabel"
0
0
Expand All @@ -259,7 +261,7 @@ jx_layout_editor 5
"InputField"
2
1
350 190 370 490
370 190 390 490
"itsWindowCmd"
1
3
Expand All @@ -272,36 +274,9 @@ jx_layout_editor 5
""
0
0

1
0
"TextButton"
1
1
360 510 380 560
"itsSaveButton"
1
0
0
"Save"
"#S"

1
0
"StaticText"
1
1
370 130 390 490
"cmdHint1"
0
0
0
"(use $q in place of quoted command, $u in place of unquoted command)"
1
0
0
0
0
"$q for quoted command
+$u for unquoted command"

1
0
Expand Down
Loading

0 comments on commit 32c65f1

Please sign in to comment.