Skip to content

Commit

Permalink
testjx: begin using jxl
Browse files Browse the repository at this point in the history
  • Loading branch information
jafl committed Jan 17, 2024
1 parent 9dd3043 commit cafa617
Show file tree
Hide file tree
Showing 14 changed files with 309 additions and 442 deletions.
6 changes: 2 additions & 4 deletions libjx/testui/code/AboutDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ AboutDialog::BuildWindow()
auto* window = jnew JXWindow(this, 100,100, JString::empty);

auto* okButton =
jnew JXTextButton(JGetString("okButton::AboutDialog::JXLayout"), window,
jnew JXTextButton(JGetString("okButton::AboutDialog::JXLayout"),window,
JXWidget::kHElastic, JXWidget::kVElastic, 10,35, 80,30);
assert( okButton != nullptr );
okButton->SetShortcuts(JGetString("okButton::AboutDialog::shortcuts::JXLayout"));
okButton->SetFontSize(JFontManager::GetDefaultFontSize()-2);
okButton->SetShortcuts(JGetString("okButton::shortcuts::AboutDialog::JXLayout"));

// end JXLayout

Expand Down
19 changes: 19 additions & 0 deletions libjx/testui/code/AboutDialog.jxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
jx_layout_editor 1
100
100
"JXLayout"
""
""
0
1
0
"TextButton"
2
2
35 10 65 90
"okButton"
0
0
"Gee, thanks!"
"tT!^["
0
33 changes: 14 additions & 19 deletions libjx/testui/code/ResizeWidgetDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,33 @@ ResizeWidgetDialog::BuildWindow

auto* window = jnew JXWindow(this, 160,120, JString::empty);

auto* widthLabel =
jnew JXStaticText(JGetString("widthLabel::ResizeWidgetDialog::JXLayout"),window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,20);
widthLabel->SetToLabel(false);

auto* heightLabel =
jnew JXStaticText(JGetString("heightLabel::ResizeWidgetDialog::JXLayout"),window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,50, 50,20);
heightLabel->SetToLabel(false);

auto* cancelButton =
jnew JXTextButton(JGetString("cancelButton::ResizeWidgetDialog::JXLayout"), window,
jnew JXTextButton(JGetString("cancelButton::ResizeWidgetDialog::JXLayout"),window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 20,90, 50,20);
assert( cancelButton != nullptr );

auto* okButton =
jnew JXTextButton(JGetString("okButton::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 90,90, 50,20);
assert( okButton != nullptr );
okButton->SetShortcuts(JGetString("okButton::ResizeWidgetDialog::shortcuts::JXLayout"));
jnew JXTextButton(JGetString("okButton::ResizeWidgetDialog::JXLayout"),window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 89,89, 52,22);
okButton->SetShortcuts(JGetString("okButton::shortcuts::ResizeWidgetDialog::JXLayout"));

itsWidth =
jnew JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,20, 70,20);
assert( itsWidth != nullptr );

itsHeight =
jnew JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 70,50, 70,20);
assert( itsHeight != nullptr );

auto* widthLabel =
jnew JXStaticText(JGetString("widthLabel::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 50,20);
assert( widthLabel != nullptr );
widthLabel->SetToLabel();

auto* heightLabel =
jnew JXStaticText(JGetString("heightLabel::ResizeWidgetDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,50, 50,20);
assert( heightLabel != nullptr );
heightLabel->SetToLabel();

// end JXLayout

Expand Down
84 changes: 84 additions & 0 deletions libjx/testui/code/ResizeWidgetDialog.jxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
jx_layout_editor 1
160
120
"JXLayout"
""
""
0
1
0
"TextButton"
1
0
90 20 110 70
"cancelButton"
0
0
"Cancel"
""
1
0
"TextButton"
1
0
90 90 110 140
"okButton"
0
0
"OK"
"^M"
1
0
"IntegerInput"
2
0
20 70 40 140
"itsWidth"
1
1
0
0 0
0 0
1
0
"IntegerInput"
2
0
50 70 70 140
"itsHeight"
1
2
0
0 0
0 0
1
0
"StaticText"
0
0
20 20 40 70
"widthLabel"
0
0
"Width:"
1
0
0
0
0
1
0
"StaticText"
0
0
50 20 70 70
"heightLabel"
0
0
"Height:"
1
0
0
0
0
0
21 changes: 9 additions & 12 deletions libjx/testui/code/SetElasticDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,24 @@ SetElasticDialog::BuildWindow

auto* window = jnew JXWindow(this, 200,90, JString::empty);

auto* elasticLabel =
jnew JXStaticText(JGetString("elasticLabel::SetElasticDialog::JXLayout"),window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,20, 130,20);
elasticLabel->SetToLabel(false);

auto* cancelButton =
jnew JXTextButton(JGetString("cancelButton::SetElasticDialog::JXLayout"), window,
jnew JXTextButton(JGetString("cancelButton::SetElasticDialog::JXLayout"),window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 30,60, 50,20);
assert( cancelButton != nullptr );

auto* okButton =
jnew JXTextButton(JGetString("okButton::SetElasticDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 120,60, 50,20);
assert( okButton != nullptr );
okButton->SetShortcuts(JGetString("okButton::SetElasticDialog::shortcuts::JXLayout"));
jnew JXTextButton(JGetString("okButton::SetElasticDialog::JXLayout"),window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 119,59, 52,22);
okButton->SetShortcuts(JGetString("okButton::shortcuts::SetElasticDialog::JXLayout"));

itsElasticIndex =
jnew JXIntegerInput(window,
JXWidget::kHElastic, JXWidget::kFixedTop, 140,20, 40,20);
assert( itsElasticIndex != nullptr );

auto* elasticLabel =
jnew JXStaticText(JGetString("elasticLabel::SetElasticDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 10,20, 130,20);
assert( elasticLabel != nullptr );
elasticLabel->SetToLabel();

// end JXLayout

Expand Down
57 changes: 57 additions & 0 deletions libjx/testui/code/SetElasticDialog.jxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
jx_layout_editor 1
200
90
"JXLayout"
""
""
0
1
0
"StaticText"
0
0
20 10 40 140
"elasticLabel"
0
0
"Elastic compartment:"
1
0
0
0
0
1
0
"IntegerInput"
2
0
20 140 40 180
"itsElasticIndex"
1
1
0
0 0
0 0
1
0
"TextButton"
1
0
60 120 80 170
"okButton"
0
0
"OK"
"^M"
1
0
"TextButton"
1
0
60 30 80 80
"cancelButton"
0
0
"Cancel"
""
0
33 changes: 16 additions & 17 deletions libjx/testui/code/TestPopupChoiceDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,31 @@ TestPopupChoiceDialog::BuildWindow()

auto* window = jnew JXWindow(this, 230,170, JString::empty);

auto* cancelButton =
jnew JXTextButton(JGetString("cancelButton::TestPopupChoiceDialog::JXLayout"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 30,140, 70,20);
assert( cancelButton != nullptr );

auto* okButton =
jnew JXTextButton(JGetString("okButton::TestPopupChoiceDialog::JXLayout"), window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 130,140, 70,20);
assert( okButton != nullptr );
okButton->SetShortcuts(JGetString("okButton::TestPopupChoiceDialog::shortcuts::JXLayout"));

auto* fontMenu =
jnew JXFontNameMenu(JGetString("FontMenuLabel::TestPopupChoiceDialog"), true, window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,20, 190,30);
jnew JXFontNameMenu(JGetString("FontMenuLabel::TestPopupChoiceDialog"), true,window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,20, 190,30);
assert( fontMenu != nullptr );

auto* sizeMenu =
jnew JXFontSizeMenu(fontMenu, JGetString("FontSizeMenuLabel::TestPopupChoiceDialog"), window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,60, 190,30);
jnew JXFontSizeMenu(fontMenu, JGetString("FontSizeMenuLabel::TestPopupChoiceDialog"),window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,60, 190,30);
assert( sizeMenu != nullptr );

auto* iconMenu =
jnew JXImageMenu(JGetString("ImageMenuLabel::TestPopupChoiceDialog"), 2, window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 20,100, 190,30);
jnew JXImageMenu(JGetString("ImageMenuLabel::TestPopupChoiceDialog"), 2,window,
JXWidget::kHElastic, JXWidget::kFixedTop, 20,100, 190,30);
assert( iconMenu != nullptr );

auto* cancelButton =
jnew JXTextButton(JGetString("cancelButton::TestPopupChoiceDialog::JXLayout"),window,
JXWidget::kFixedLeft, JXWidget::kFixedTop, 30,140, 70,20);
assert( cancelButton != nullptr );

auto* okButton =
jnew JXTextButton(JGetString("okButton::TestPopupChoiceDialog::JXLayout"),window,
JXWidget::kFixedRight, JXWidget::kFixedTop, 129,139, 72,22);
okButton->SetShortcuts(JGetString("okButton::shortcuts::TestPopupChoiceDialog::JXLayout"));

// end JXLayout

window->SetTitle(JGetString("WindowTitle::TestPopupChoiceDialog"));
Expand Down
66 changes: 66 additions & 0 deletions libjx/testui/code/TestPopupChoiceDialog.jxl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
jx_layout_editor 1
230
170
"JXLayout"
""
""
0
1
0
"CustomWidget"
2
0
100 20 130 210
"iconMenu"
0
0
"JXImageMenu"
"JGetString(\"ImageMenuLabel::TestPopupChoiceDialog\"), 2,"
0
1
0
"CustomWidget"
2
0
60 20 90 210
"sizeMenu"
0
0
"JXFontSizeMenu"
"fontMenu, JGetString(\"FontSizeMenuLabel::TestPopupChoiceDialog\"),"
0
1
0
"CustomWidget"
2
0
20 20 50 210
"fontMenu"
0
0
"JXFontNameMenu"
"JGetString(\"FontMenuLabel::TestPopupChoiceDialog\"), true,"
0
1
0
"TextButton"
1
0
140 130 160 200
"okButton"
0
0
"OK"
"^M"
1
0
"TextButton"
0
0
140 30 160 100
"cancelButton"
0
0
"Cancel"
""
0
7 changes: 6 additions & 1 deletion libjx/testui/strings/AboutDialog_layout
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0
okButton::AboutDialog::shortcuts::JXLayout "tT!^["
okButton::AboutDialog::JXLayout "Gee, thanks!"
okButton::shortcuts::AboutDialog::JXLayout "tT!^["


# This file was automatically generated by jx_layout_editor.
# Do not edit it directly!
# Any changes you make will be silently overwritten.
Loading

0 comments on commit cafa617

Please sign in to comment.