Skip to content

Commit

Permalink
jx_layout_editor: prevent negative sizes for partition compartments
Browse files Browse the repository at this point in the history
  • Loading branch information
jafl committed Feb 11, 2024
1 parent 24968ad commit 80bb863
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 0 additions & 2 deletions todo-jxlayout
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ expand scrollbarSet vertically in main layout: too tall

open AboutDialog.jxl with toolbar visible - doesn't compensate correctly
but it does work when the window is already open

+ disallow negative numbers for partition min sizes
24 changes: 24 additions & 0 deletions tools/jx_layout_editor/code/PartitionMinSizeTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
******************************************************************************/

#include "PartitionMinSizeTable.h"
#include <jx-af/jx/JXIntegerInput.h>
#include <jx-af/jcore/jAssert.h>

/******************************************************************************
Expand Down Expand Up @@ -95,3 +96,26 @@ PartitionMinSizeTable::ApertureResized
JXIntegerTable::ApertureResized(dw,dh);
SetColWidth(1, GetApertureWidth());
}

/******************************************************************************
CreateIntegerTableInput (virtual protected)
******************************************************************************/

JXIntegerInput*
PartitionMinSizeTable::CreateIntegerTableInput
(
const JPoint& cell,
JXContainer* enclosure,
const HSizingOption hSizing,
const VSizingOption vSizing,
const JCoordinate x,
const JCoordinate y,
const JCoordinate w,
const JCoordinate h
)
{
auto* obj = jnew JXIntegerInput(enclosure, hSizing, vSizing, x,y, w,h);
obj->SetLowerLimit(10);
return obj;
}
6 changes: 6 additions & 0 deletions tools/jx_layout_editor/code/PartitionMinSizeTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ class PartitionMinSizeTable : public JXIntegerTable
const JXKeyModifiers& modifiers) override;

void ApertureResized(const JCoordinate dw, const JCoordinate dh) override;

JXIntegerInput*
CreateIntegerTableInput(const JPoint& cell, JXContainer* enclosure,
const HSizingOption hSizing, const VSizingOption vSizing,
const JCoordinate x, const JCoordinate y,
const JCoordinate w, const JCoordinate h) override;
};

#endif

0 comments on commit 80bb863

Please sign in to comment.