Skip to content

Commit

Permalink
rename property name
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-numerical-software committed Jul 28, 2024
1 parent 234dbae commit 556d7a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions modules/graphics/src/cpp/GOUIControlProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ GOUIControl::constructProperties()
registerProperty(new GOFontUnitsProperty, GO_FONT_UNITS_PROPERTY_NAME_STR);
registerProperty(new GOAlignHorizProperty, GO_HORIZONTAL_ALIGNMENT_PROPERTY_NAME_STR);
registerProperty(new GOOnOffProperty, GO_ENABLE_PROPERTY_NAME_STR);
registerProperty(new GOStringProperty, GO_TOOLTIPS_STRING_PROPERTY_NAME_STR);
registerProperty(new GOStringProperty, GO_TOOLTIP_PROPERTY_NAME_STR);
registerProperty(new GOScalarProperty, GO_MIN_PROPERTY_NAME_STR);
registerProperty(new GOScalarProperty, GO_MAX_PROPERTY_NAME_STR);
registerProperty(new GOScalarProperty, GO_VALUE_PROPERTY_NAME_STR);
Expand Down Expand Up @@ -101,7 +101,7 @@ GOUIControl::setupDefaults()
GO_HORIZONTAL_ALIGNMENT_PROPERTY_NAME_STR, GO_PROPERTY_VALUE_CENTER_STR);
setRestrictedStringDefault(GO_ENABLE_PROPERTY_NAME_STR, GO_PROPERTY_VALUE_ON_STR);
setRestrictedStringDefault(GO_STYLE_PROPERTY_NAME_STR, GO_PROPERTY_VALUE_PUSHBUTTON_STR);
setStringDefault(GO_TOOLTIPS_STRING_PROPERTY_NAME_STR, L"");
setStringDefault(GO_TOOLTIP_PROPERTY_NAME_STR, L"");
setScalarDoubleDefault(GO_MIN_PROPERTY_NAME_STR, 0);
setScalarDoubleDefault(GO_MAX_PROPERTY_NAME_STR, 1);
setScalarDoubleDefault(GO_VALUE_PROPERTY_NAME_STR, 0);
Expand Down Expand Up @@ -366,10 +366,10 @@ GOUIControl::onRadioButtonChanged(bool newWidget)
void
GOUIControl::onToolTipsChanged(bool newWidget)
{
if (hasChanged(GO_TOOLTIPS_STRING_PROPERTY_NAME_STR) || newWidget) {
std::wstring str = findStringProperty(GO_TOOLTIPS_STRING_PROPERTY_NAME_STR);
if (hasChanged(GO_TOOLTIP_PROPERTY_NAME_STR) || newWidget) {
std::wstring str = findStringProperty(GO_TOOLTIP_PROPERTY_NAME_STR);
widget->setToolTip(wstringToQString(str));
clearChanged(GO_TOOLTIPS_STRING_PROPERTY_NAME_STR);
clearChanged(GO_TOOLTIP_PROPERTY_NAME_STR);
}
}
//=============================================================================
Expand All @@ -392,6 +392,9 @@ GOUIControl::onListTopBoxChanged(bool newWidget)
for (size_t k = 0; k < values.size(); k++) {
((QListWidget*)widget)->addItem(wstringToQString(values[k]));
}
if (!values.empty() && findScalarDoubleProperty(GO_VALUE_PROPERTY_NAME_STR) == 0) {
setScalarDoubleDefault(GO_VALUE_PROPERTY_NAME_STR, 1);
}
}

if (stringCheck(GO_STYLE_PROPERTY_NAME_STR, GO_PROPERTY_VALUE_LISTBOX_STR)
Expand Down Expand Up @@ -438,6 +441,9 @@ GOUIControl::onPopupMenuChanged(bool newWidget)
for (size_t k = 0; k < values.size(); k++) {
((QComboBox*)widget)->addItem(wstringToQString(values[k]));
}
if (!values.empty() && findScalarDoubleProperty(GO_VALUE_PROPERTY_NAME_STR) == 0) {
setScalarDoubleDefault(GO_VALUE_PROPERTY_NAME_STR, 1);
}
}
}
//=============================================================================
Expand Down
2 changes: 1 addition & 1 deletion modules/graphics/src/include/GOPropertyNames.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
#define GO_TIGHT_INSET_PROPERTY_NAME_STR L"TightInset"
#define GO_TITLE_PROPERTY_NAME_STR L"Title"
#define GO_TOOL_BAR_PROPERTY_NAME_STR L"ToolBar"
#define GO_TOOLTIPS_STRING_PROPERTY_NAME_STR L"tooltipstring"
#define GO_TOOLTIP_PROPERTY_NAME_STR L"Tooltip"
#define GO_TYPE_PROPERTY_NAME_STR L"Type"
#define GO_UNITS_PROPERTY_NAME_STR L"Units"
#define GO_USER_DATA_PROPERTY_NAME_STR L"UserData"
Expand Down

0 comments on commit 556d7a7

Please sign in to comment.