Correction of some virtual methods
This commit is contained in:
parent
6de04a3edd
commit
136b57eac6
|
@ -472,7 +472,7 @@ use `delCallbacks()` to remove all existing callbacks from an object.
|
||||||
<dd>"clicked"<br />"toggled"</dd>
|
<dd>"clicked"<br />"toggled"</dd>
|
||||||
|
|
||||||
<dt>FWidget</dt>
|
<dt>FWidget</dt>
|
||||||
<dd>"destroy"<br />"focus-in"<br />"focus-out"<br />"mouse-press"<br />"mouse-release"<br />"mouse-move"<br />"mouse-wheel-down"<br />"mouse-wheel-up"</dd>
|
<dd>"destroy"<br />"enable"<br />"disable"<br />"focus-in"<br />"focus-out"<br />"mouse-press"<br />"mouse-release"<br />"mouse-move"<br />"mouse-wheel-down"<br />"mouse-wheel-up"</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -745,7 +745,7 @@ void FLineEdit::drawInputField()
|
||||||
if ( isActiveFocus && getMaxColor() < 16 )
|
if ( isActiveFocus && getMaxColor() < 16 )
|
||||||
setBold();
|
setBold();
|
||||||
|
|
||||||
const std::size_t text_offset_column = [&] () -> std::size_t
|
const std::size_t text_offset_column = [this] () -> std::size_t
|
||||||
{
|
{
|
||||||
switch ( input_type )
|
switch ( input_type )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1534,12 +1534,12 @@ inline void FListView::mapKeyFunctions()
|
||||||
key_map[fc::Fkey_return] = std::bind(&FListView::processClick, this);
|
key_map[fc::Fkey_return] = std::bind(&FListView::processClick, this);
|
||||||
key_map[fc::Fkey_enter] = std::bind(&FListView::processClick, this);
|
key_map[fc::Fkey_enter] = std::bind(&FListView::processClick, this);
|
||||||
key_map[fc::Fkey_space] = std::bind(&FListView::toggleCheckbox, this);
|
key_map[fc::Fkey_space] = std::bind(&FListView::toggleCheckbox, this);
|
||||||
key_map[fc::Fkey_up] = [&] { stepBackward(); };
|
key_map[fc::Fkey_up] = [this] { stepBackward(); };
|
||||||
key_map[fc::Fkey_down] = [&] { stepForward(); };
|
key_map[fc::Fkey_down] = [this] { stepForward(); };
|
||||||
key_map[fc::Fkey_left] = std::bind(&FListView::collapseAndScrollLeft, this);
|
key_map[fc::Fkey_left] = std::bind(&FListView::collapseAndScrollLeft, this);
|
||||||
key_map[fc::Fkey_right] = std::bind(&FListView::expandAndScrollRight, this);
|
key_map[fc::Fkey_right] = std::bind(&FListView::expandAndScrollRight, this);
|
||||||
key_map[fc::Fkey_ppage] = [&] { stepBackward(int(getClientHeight()) - 1); };
|
key_map[fc::Fkey_ppage] = [this] { stepBackward(int(getClientHeight()) - 1); };
|
||||||
key_map[fc::Fkey_npage] = [&] { stepForward(int(getClientHeight()) - 1); };
|
key_map[fc::Fkey_npage] = [this] { stepForward(int(getClientHeight()) - 1); };
|
||||||
key_map[fc::Fkey_home] = std::bind(&FListView::firstPos, this);
|
key_map[fc::Fkey_home] = std::bind(&FListView::firstPos, this);
|
||||||
key_map[fc::Fkey_end] = std::bind(&FListView::lastPos, this);
|
key_map[fc::Fkey_end] = std::bind(&FListView::lastPos, this);
|
||||||
key_map_result[FKey('+')] = std::bind(&FListView::expandSubtree, this);
|
key_map_result[FKey('+')] = std::bind(&FListView::expandSubtree, this);
|
||||||
|
|
|
@ -316,6 +316,18 @@ void FMenu::onMouseMove (FMouseEvent* ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FMenu::cb_menuitemEnabled (FWidget*, const FDataPtr)
|
||||||
|
{
|
||||||
|
setEnable();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FMenu::cb_menuitemDisabled (FWidget*, const FDataPtr)
|
||||||
|
{
|
||||||
|
setDisable();
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr)
|
void FMenu::cb_menuitemToggled (FWidget* widget, const FDataPtr)
|
||||||
{
|
{
|
||||||
|
@ -467,9 +479,26 @@ void FMenu::init(FWidget* parent)
|
||||||
setSuperMenu(parent);
|
setSuperMenu(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
initCallbacks();
|
||||||
calculateDimensions();
|
calculateDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FMenu::initCallbacks()
|
||||||
|
{
|
||||||
|
menuitem.addCallback
|
||||||
|
(
|
||||||
|
"enable",
|
||||||
|
F_METHOD_CALLBACK (this, &FMenu::cb_menuitemEnabled)
|
||||||
|
);
|
||||||
|
|
||||||
|
menuitem.addCallback
|
||||||
|
(
|
||||||
|
"disable",
|
||||||
|
F_METHOD_CALLBACK (this, &FMenu::cb_menuitemEnabled)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenu::calculateDimensions()
|
void FMenu::calculateDimensions()
|
||||||
{
|
{
|
||||||
|
@ -686,7 +715,7 @@ void FMenu::mouseDownSubmenu (const FMenuItem* m_item)
|
||||||
if ( ! sel_item
|
if ( ! sel_item
|
||||||
|| ! sel_item->hasMenu()
|
|| ! sel_item->hasMenu()
|
||||||
|| sel_item->getMenu() != opened_sub_menu )
|
|| sel_item->getMenu() != opened_sub_menu )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( sel_item != m_item )
|
if ( sel_item != m_item )
|
||||||
hideSubMenus();
|
hideSubMenus();
|
||||||
|
|
|
@ -564,6 +564,18 @@ void FMenuItem::updateSuperMenuDimensions()
|
||||||
menu_ptr->calculateDimensions();
|
menu_ptr->calculateDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FMenuItem::processEnable()
|
||||||
|
{
|
||||||
|
emitCallback("enable");
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void FMenuItem::processDisable()
|
||||||
|
{
|
||||||
|
emitCallback("disable");
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FMenuItem::processActivate()
|
void FMenuItem::processActivate()
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,10 +277,10 @@ void FScrollView::setGeometry ( const FPoint& pos, const FSize& size
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FScrollView::setCursorPos (const FPoint& p)
|
bool FScrollView::setCursorPos (const FPoint& p)
|
||||||
{
|
{
|
||||||
FWidget::setCursorPos (FPoint ( p.getX() + getLeftPadding()
|
return FWidget::setCursorPos (FPoint ( p.getX() + getLeftPadding()
|
||||||
, p.getY() + getTopPadding() ));
|
, p.getY() + getTopPadding() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -751,15 +751,15 @@ void FScrollView::init (const FWidget* parent)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FScrollView::mapKeyFunctions()
|
inline void FScrollView::mapKeyFunctions()
|
||||||
{
|
{
|
||||||
key_map[fc::Fkey_up] = [&] { scrollBy (0, -1); };
|
key_map[fc::Fkey_up] = [this] { scrollBy (0, -1); };
|
||||||
key_map[fc::Fkey_down] = [&] { scrollBy (0, 1); };
|
key_map[fc::Fkey_down] = [this] { scrollBy (0, 1); };
|
||||||
key_map[fc::Fkey_left] = [&] { scrollBy (-1, 0); };
|
key_map[fc::Fkey_left] = [this] { scrollBy (-1, 0); };
|
||||||
key_map[fc::Fkey_right] = [&] { scrollBy (1, 0); };
|
key_map[fc::Fkey_right] = [this] { scrollBy (1, 0); };
|
||||||
key_map[fc::Fkey_ppage] = [&] { scrollBy (0, -int(getViewportHeight())); };
|
key_map[fc::Fkey_ppage] = [this] { scrollBy (0, -int(getViewportHeight())); };
|
||||||
key_map[fc::Fkey_npage] = [&] { scrollBy (0, int(getViewportHeight())); };
|
key_map[fc::Fkey_npage] = [this] { scrollBy (0, int(getViewportHeight())); };
|
||||||
key_map[fc::Fkey_home] = [&] { scrollToY (1); };
|
key_map[fc::Fkey_home] = [this] { scrollToY (1); };
|
||||||
key_map[fc::Fkey_end] = \
|
key_map[fc::Fkey_end] = \
|
||||||
[&] ()
|
[this] ()
|
||||||
{
|
{
|
||||||
int yoffset_end = int(getScrollHeight() - getViewportHeight());
|
int yoffset_end = int(getScrollHeight() - getViewportHeight());
|
||||||
scrollToY (1 + yoffset_end);
|
scrollToY (1 + yoffset_end);
|
||||||
|
|
|
@ -325,7 +325,7 @@ void FSpinBox::draw()
|
||||||
{
|
{
|
||||||
const auto& wc = getFWidgetColors();
|
const auto& wc = getFWidgetColors();
|
||||||
|
|
||||||
const FColorPair inc_button_color = [&] ()
|
const FColorPair inc_button_color = [this, &wc] ()
|
||||||
{
|
{
|
||||||
if ( value == max )
|
if ( value == max )
|
||||||
return FColorPair ( wc.scrollbar_button_inactive_fg
|
return FColorPair ( wc.scrollbar_button_inactive_fg
|
||||||
|
@ -335,7 +335,7 @@ void FSpinBox::draw()
|
||||||
, wc.scrollbar_button_bg );
|
, wc.scrollbar_button_bg );
|
||||||
}();
|
}();
|
||||||
|
|
||||||
const FColorPair dec_button_color = [&] ()
|
const FColorPair dec_button_color = [this, &wc] ()
|
||||||
{
|
{
|
||||||
if ( value == min )
|
if ( value == min )
|
||||||
return FColorPair ( wc.scrollbar_button_inactive_fg
|
return FColorPair ( wc.scrollbar_button_inactive_fg
|
||||||
|
|
|
@ -598,7 +598,7 @@ bool FTerm::canChangeColorPalette()
|
||||||
|| isOpenBSDTerm()
|
|| isOpenBSDTerm()
|
||||||
|| isSunTerminal()
|
|| isSunTerminal()
|
||||||
|| isAnsiTerminal() )
|
|| isAnsiTerminal() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return FTermcap::can_change_color_palette;
|
return FTermcap::can_change_color_palette;
|
||||||
}
|
}
|
||||||
|
|
|
@ -559,7 +559,7 @@ void FTermcapQuirks::ecma48()
|
||||||
// Test for standard ECMA-48 (ANSI X3.64) terminal
|
// Test for standard ECMA-48 (ANSI X3.64) terminal
|
||||||
if ( ! TCAP(fc::t_exit_underline_mode)
|
if ( ! TCAP(fc::t_exit_underline_mode)
|
||||||
|| std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) != 0 )
|
|| std::strncmp(TCAP(fc::t_exit_underline_mode), CSI "24m", 5) != 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Seems to be a ECMA-48 (ANSI X3.64) compatible terminal
|
// Seems to be a ECMA-48 (ANSI X3.64) compatible terminal
|
||||||
TCAP(fc::t_enter_dbl_underline_mode) = \
|
TCAP(fc::t_enter_dbl_underline_mode) = \
|
||||||
|
|
|
@ -571,14 +571,14 @@ void FTextView::init()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline void FTextView::mapKeyFunctions()
|
inline void FTextView::mapKeyFunctions()
|
||||||
{
|
{
|
||||||
key_map[fc::Fkey_up] = [&] { scrollBy (0, -1); };
|
key_map[fc::Fkey_up] = [this] { scrollBy (0, -1); };
|
||||||
key_map[fc::Fkey_down] = [&] { scrollBy (0, 1); };
|
key_map[fc::Fkey_down] = [this] { scrollBy (0, 1); };
|
||||||
key_map[fc::Fkey_left] = [&] { scrollBy (-1, 0); };
|
key_map[fc::Fkey_left] = [this] { scrollBy (-1, 0); };
|
||||||
key_map[fc::Fkey_right] = [&] { scrollBy (1, 0); };
|
key_map[fc::Fkey_right] = [this] { scrollBy (1, 0); };
|
||||||
key_map[fc::Fkey_ppage] = [&] { scrollBy (0, -int(getTextHeight())); };
|
key_map[fc::Fkey_ppage] = [this] { scrollBy (0, -int(getTextHeight())); };
|
||||||
key_map[fc::Fkey_npage] = [&] { scrollBy (0, int(getTextHeight())); };
|
key_map[fc::Fkey_npage] = [this] { scrollBy (0, int(getTextHeight())); };
|
||||||
key_map[fc::Fkey_home] = [&] { scrollToY (0); };
|
key_map[fc::Fkey_home] = [this] { scrollToY (0); };
|
||||||
key_map[fc::Fkey_end] = [&] { scrollToY (int(getRows() - getTextHeight())); };
|
key_map[fc::Fkey_end] = [this] { scrollToY (int(getRows() - getTextHeight())); };
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -269,6 +269,11 @@ bool FWidget::setVisible (bool enable)
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FWidget::setEnable (bool enable)
|
bool FWidget::setEnable (bool enable)
|
||||||
{
|
{
|
||||||
|
if ( enable )
|
||||||
|
emitCallback("enable");
|
||||||
|
else
|
||||||
|
emitCallback("disable");
|
||||||
|
|
||||||
return (flags.active = enable);
|
return (flags.active = enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1814,7 +1819,7 @@ void FWidget::KeyPressEvent (FKeyEvent* kev)
|
||||||
{
|
{
|
||||||
const FKey key = kev->key();
|
const FKey key = kev->key();
|
||||||
|
|
||||||
if ( [&] ()
|
if ( [this, &key] ()
|
||||||
{
|
{
|
||||||
if ( isFocusNextKey(key) )
|
if ( isFocusNextKey(key) )
|
||||||
return focusNextChild();
|
return focusNextChild();
|
||||||
|
|
|
@ -81,8 +81,8 @@ class FButton : public FWidget
|
||||||
FString& getText();
|
FString& getText();
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
void setForegroundColor (FColor);
|
void setForegroundColor (FColor) override;
|
||||||
void setBackgroundColor (FColor);
|
void setBackgroundColor (FColor) override;
|
||||||
void setHotkeyForegroundColor (FColor);
|
void setHotkeyForegroundColor (FColor);
|
||||||
void setFocusForegroundColor (FColor);
|
void setFocusForegroundColor (FColor);
|
||||||
void setFocusBackgroundColor (FColor);
|
void setFocusBackgroundColor (FColor);
|
||||||
|
|
|
@ -91,67 +91,67 @@ class FDialog : public FWindow
|
||||||
FDialog& operator = (const FDialog&) = delete;
|
FDialog& operator = (const FDialog&) = delete;
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
const FString getClassName() const override;
|
const FString getClassName() const override;
|
||||||
FString getText() const;
|
virtual const FString getText() const;
|
||||||
|
|
||||||
// Mutators
|
// Mutators
|
||||||
bool setDialogWidget (bool);
|
bool setDialogWidget (bool);
|
||||||
bool setDialogWidget();
|
bool setDialogWidget();
|
||||||
bool unsetDialogWidget();
|
bool unsetDialogWidget();
|
||||||
bool setModal (bool);
|
bool setModal (bool);
|
||||||
bool setModal();
|
bool setModal();
|
||||||
bool unsetModal();
|
bool unsetModal();
|
||||||
bool setResizeable (bool) override;
|
bool setResizeable (bool) override;
|
||||||
bool setScrollable (bool);
|
bool setScrollable (bool);
|
||||||
bool setScrollable();
|
bool setScrollable();
|
||||||
bool unsetScrollable();
|
bool unsetScrollable();
|
||||||
bool setBorder (bool);
|
bool setBorder (bool);
|
||||||
bool setBorder();
|
bool setBorder();
|
||||||
bool unsetBorder();
|
bool unsetBorder();
|
||||||
void setText (const FString&);
|
virtual void setText (const FString&);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
bool isModal() const;
|
bool isModal() const;
|
||||||
bool isScrollable() const;
|
bool isScrollable() const;
|
||||||
bool hasBorder() const;
|
bool hasBorder() const;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void show() override;
|
void show() override;
|
||||||
void hide() override;
|
void hide() override;
|
||||||
int exec();
|
int exec();
|
||||||
void setPos (const FPoint&, bool = true) override;
|
void setPos (const FPoint&, bool = true) override;
|
||||||
void move (const FPoint&) override;
|
void move (const FPoint&) override;
|
||||||
bool moveUp (int);
|
bool moveUp (int);
|
||||||
bool moveDown (int);
|
bool moveDown (int);
|
||||||
bool moveLeft (int);
|
bool moveLeft (int);
|
||||||
bool moveRight (int);
|
bool moveRight (int);
|
||||||
void setSize (const FSize&, bool = true) override;
|
void setSize (const FSize&, bool = true) override;
|
||||||
bool reduceHeight (int);
|
bool reduceHeight (int);
|
||||||
bool expandHeight (int);
|
bool expandHeight (int);
|
||||||
bool reduceWidth (int);
|
bool reduceWidth (int);
|
||||||
bool expandWidth (int);
|
bool expandWidth (int);
|
||||||
void activateDialog();
|
void activateDialog();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onKeyPress (FKeyEvent*) override;
|
void onKeyPress (FKeyEvent*) override;
|
||||||
void onMouseDown (FMouseEvent*) override;
|
void onMouseDown (FMouseEvent*) override;
|
||||||
void onMouseUp (FMouseEvent*) override;
|
void onMouseUp (FMouseEvent*) override;
|
||||||
void onMouseMove (FMouseEvent*) override;
|
void onMouseMove (FMouseEvent*) override;
|
||||||
void onMouseDoubleClick (FMouseEvent*) override;
|
void onMouseDoubleClick (FMouseEvent*) override;
|
||||||
void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
void onWindowActive (FEvent*) override;
|
void onWindowActive (FEvent*) override;
|
||||||
void onWindowInactive (FEvent*) override;
|
void onWindowInactive (FEvent*) override;
|
||||||
void onWindowRaised (FEvent*) override;
|
void onWindowRaised (FEvent*) override;
|
||||||
void onWindowLowered (FEvent*) override;
|
void onWindowLowered (FEvent*) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Methods
|
// Methods
|
||||||
virtual void done (int);
|
virtual void done (int);
|
||||||
void draw() override;
|
void draw() override;
|
||||||
void drawDialogShadow();
|
void drawDialogShadow();
|
||||||
|
|
||||||
// Event handlers
|
// Event handlers
|
||||||
void onClose (FCloseEvent*) override;
|
void onClose (FCloseEvent*) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Typedef
|
// Typedef
|
||||||
|
@ -169,65 +169,65 @@ class FDialog : public FWindow
|
||||||
static constexpr bool PRINT_WIN_NUMBER = false; // Only for debug
|
static constexpr bool PRINT_WIN_NUMBER = false; // Only for debug
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void init();
|
void init();
|
||||||
void initDialogMenu();
|
void initDialogMenu();
|
||||||
void initMoveSizeMenuItem (FMenu*);
|
void initMoveSizeMenuItem (FMenu*);
|
||||||
void initZoomMenuItem (FMenu*);
|
void initZoomMenuItem (FMenu*);
|
||||||
void initCloseMenuItem (FMenu*);
|
void initCloseMenuItem (FMenu*);
|
||||||
void drawBorder() override;
|
void drawBorder() override;
|
||||||
void drawTitleBar();
|
void drawTitleBar();
|
||||||
void drawBarButton();
|
void drawBarButton();
|
||||||
void drawZoomButton();
|
void drawZoomButton();
|
||||||
void drawRestoreSizeButton();
|
void drawRestoreSizeButton();
|
||||||
void drawZoomedButton();
|
void drawZoomedButton();
|
||||||
void drawTextBar();
|
void drawTextBar();
|
||||||
void restoreOverlaidWindows();
|
void restoreOverlaidWindows();
|
||||||
void setCursorToFocusWidget();
|
void setCursorToFocusWidget();
|
||||||
void leaveMenu();
|
void leaveMenu();
|
||||||
void openMenu();
|
void openMenu();
|
||||||
void selectFirstMenuItem();
|
void selectFirstMenuItem();
|
||||||
void setZoomItem();
|
void setZoomItem();
|
||||||
std::size_t getZoomButtonWidth();
|
std::size_t getZoomButtonWidth();
|
||||||
void activateZoomButton (const mouseStates&);
|
void activateZoomButton (const mouseStates&);
|
||||||
void deactivateZoomButton();
|
void deactivateZoomButton();
|
||||||
void leaveZoomButton (const mouseStates&);
|
void leaveZoomButton (const mouseStates&);
|
||||||
void pressZoomButton (const mouseStates&);
|
void pressZoomButton (const mouseStates&);
|
||||||
bool isMouseOverMenu (const FPoint&);
|
bool isMouseOverMenu (const FPoint&);
|
||||||
void passEventToSubMenu (const mouseStates&, const FMouseEvent*);
|
void passEventToSubMenu (const mouseStates&, const FMouseEvent*);
|
||||||
void moveSizeKey (FKeyEvent*);
|
void moveSizeKey (FKeyEvent*);
|
||||||
void raiseActivateDialog();
|
void raiseActivateDialog();
|
||||||
void lowerActivateDialog();
|
void lowerActivateDialog();
|
||||||
bool isOutsideTerminal (const FPoint&);
|
bool isOutsideTerminal (const FPoint&);
|
||||||
bool isLowerRightResizeCorner (const mouseStates&);
|
bool isLowerRightResizeCorner (const mouseStates&);
|
||||||
void resizeMouseDown (const mouseStates&);
|
void resizeMouseDown (const mouseStates&);
|
||||||
void resizeMouseUpMove (const mouseStates&, bool = false);
|
void resizeMouseUpMove (const mouseStates&, bool = false);
|
||||||
void cancelMouseResize();
|
void cancelMouseResize();
|
||||||
void acceptMoveSize();
|
void acceptMoveSize();
|
||||||
void cancelMoveSize();
|
void cancelMoveSize();
|
||||||
static void addDialog (FWidget*);
|
static void addDialog (FWidget*);
|
||||||
static void delDialog (const FWidget*);
|
static void delDialog (const FWidget*);
|
||||||
|
|
||||||
// Callback methods
|
// Callback methods
|
||||||
void cb_move (const FWidget*, const FDataPtr);
|
void cb_move (const FWidget*, const FDataPtr);
|
||||||
void cb_zoom (const FWidget*, const FDataPtr);
|
void cb_zoom (const FWidget*, const FDataPtr);
|
||||||
void cb_close (const FWidget*, const FDataPtr);
|
void cb_close (const FWidget*, const FDataPtr);
|
||||||
|
|
||||||
// Data members
|
// Data members
|
||||||
FString tb_text{}; // title bar text
|
FString tb_text{}; // title bar text
|
||||||
int result_code{FDialog::Reject};
|
int result_code{FDialog::Reject};
|
||||||
bool zoom_button_pressed{false};
|
bool zoom_button_pressed{false};
|
||||||
bool zoom_button_active{false};
|
bool zoom_button_active{false};
|
||||||
bool setPos_error{false};
|
bool setPos_error{false};
|
||||||
bool setSize_error{false};
|
bool setSize_error{false};
|
||||||
FPoint titlebar_click_pos{};
|
FPoint titlebar_click_pos{};
|
||||||
FPoint resize_click_pos{};
|
FPoint resize_click_pos{};
|
||||||
FRect save_geometry{}; // required by keyboard move/size
|
FRect save_geometry{}; // required by keyboard move/size
|
||||||
FMenu* dialog_menu{nullptr};
|
FMenu* dialog_menu{nullptr};
|
||||||
FMenuItem* dgl_menuitem{nullptr};
|
FMenuItem* dgl_menuitem{nullptr};
|
||||||
FMenuItem* move_size_item{nullptr};
|
FMenuItem* move_size_item{nullptr};
|
||||||
FMenuItem* zoom_item{nullptr};
|
FMenuItem* zoom_item{nullptr};
|
||||||
FMenuItem* close_item{nullptr};
|
FMenuItem* close_item{nullptr};
|
||||||
FToolTip* tooltip{nullptr};
|
FToolTip* tooltip{nullptr};
|
||||||
|
|
||||||
// Friend function from FMenu
|
// Friend function from FMenu
|
||||||
friend void FMenu::hideSuperMenus();
|
friend void FMenu::hideSuperMenus();
|
||||||
|
@ -239,7 +239,7 @@ inline const FString FDialog::getClassName() const
|
||||||
{ return "FDialog"; }
|
{ return "FDialog"; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline FString FDialog::getText() const
|
inline const FString FDialog::getText() const
|
||||||
{ return tb_text; }
|
{ return tb_text; }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
|
@ -71,6 +71,9 @@ class FMenuItem;
|
||||||
class FMenu : public FWindow, public FMenuList
|
class FMenu : public FWindow, public FMenuList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// Using-declaration
|
||||||
|
using FMenuList::getItem;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
explicit FMenu (FWidget* = nullptr);
|
explicit FMenu (FWidget* = nullptr);
|
||||||
explicit FMenu (const FString&, FWidget* = nullptr);
|
explicit FMenu (const FString&, FWidget* = nullptr);
|
||||||
|
@ -104,7 +107,6 @@ class FMenu : public FWindow, public FMenuList
|
||||||
void setText (const FString&);
|
void setText (const FString&);
|
||||||
|
|
||||||
// Inquiries
|
// Inquiries
|
||||||
bool isEnabled() const;
|
|
||||||
bool isSelected() const;
|
bool isSelected() const;
|
||||||
bool hasHotkey() const;
|
bool hasHotkey() const;
|
||||||
bool hasMenu() const;
|
bool hasMenu() const;
|
||||||
|
@ -121,6 +123,8 @@ class FMenu : public FWindow, public FMenuList
|
||||||
void onAccel (FAccelEvent*) override;
|
void onAccel (FAccelEvent*) override;
|
||||||
|
|
||||||
// Callback method
|
// Callback method
|
||||||
|
void cb_menuitemEnabled (FWidget*, const FDataPtr);
|
||||||
|
void cb_menuitemDisabled (FWidget*, const FDataPtr);
|
||||||
void cb_menuitemToggled (FWidget*, const FDataPtr);
|
void cb_menuitemToggled (FWidget*, const FDataPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -167,6 +171,7 @@ class FMenu : public FWindow, public FMenuList
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void init(FWidget*);
|
void init(FWidget*);
|
||||||
|
void initCallbacks();
|
||||||
void calculateDimensions();
|
void calculateDimensions();
|
||||||
void adjustItems();
|
void adjustItems();
|
||||||
int adjustX(int);
|
int adjustX(int);
|
||||||
|
@ -290,10 +295,6 @@ inline void FMenu::setMenu (FMenu* m)
|
||||||
inline void FMenu::setText (const FString& txt)
|
inline void FMenu::setText (const FString& txt)
|
||||||
{ menuitem.setText(txt); }
|
{ menuitem.setText(txt); }
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
|
||||||
inline bool FMenu::isEnabled() const
|
|
||||||
{ return menuitem.isEnabled(); }
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
inline bool FMenu::isSelected() const
|
inline bool FMenu::isSelected() const
|
||||||
{ return menuitem.isSelected(); }
|
{ return menuitem.isSelected(); }
|
||||||
|
|
|
@ -156,6 +156,8 @@ class FMenuItem : public FWidget
|
||||||
// Methods
|
// Methods
|
||||||
void init (FWidget*);
|
void init (FWidget*);
|
||||||
void updateSuperMenuDimensions();
|
void updateSuperMenuDimensions();
|
||||||
|
void processEnable();
|
||||||
|
void processDisable();
|
||||||
void processActivate();
|
void processActivate();
|
||||||
void processDeactivate();
|
void processDeactivate();
|
||||||
void createDialogList (FMenu*);
|
void createDialogList (FMenu*);
|
||||||
|
|
|
@ -104,7 +104,7 @@ class FMessageBox : public FDialog
|
||||||
const FString getClassName() const override;
|
const FString getClassName() const override;
|
||||||
const FString getTitlebarText() const;
|
const FString getTitlebarText() const;
|
||||||
const FString getHeadline() const;
|
const FString getHeadline() const;
|
||||||
const FString getText() const;
|
const FString getText() const override;
|
||||||
|
|
||||||
// Mutator
|
// Mutator
|
||||||
void setTitlebarText (const FString&);
|
void setTitlebarText (const FString&);
|
||||||
|
@ -112,7 +112,7 @@ class FMessageBox : public FDialog
|
||||||
bool setCenterText(bool);
|
bool setCenterText(bool);
|
||||||
bool setCenterText();
|
bool setCenterText();
|
||||||
bool unsetCenterText();
|
bool unsetCenterText();
|
||||||
void setText (const FString&);
|
void setText (const FString&) override;
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
template <typename messageType>
|
template <typename messageType>
|
||||||
|
|
|
@ -103,8 +103,8 @@ class FScrollView : public FWidget
|
||||||
void setSize (const FSize&, bool = true) override;
|
void setSize (const FSize&, bool = true) override;
|
||||||
void setGeometry ( const FPoint&, const FSize&
|
void setGeometry ( const FPoint&, const FSize&
|
||||||
, bool = true ) override;
|
, bool = true ) override;
|
||||||
void setCursorPos (const FPoint&);
|
bool setCursorPos (const FPoint&) override;
|
||||||
void setPrintPos (const FPoint&);
|
void setPrintPos (const FPoint&) override;
|
||||||
bool setViewportPrint (bool);
|
bool setViewportPrint (bool);
|
||||||
bool setViewportPrint();
|
bool setViewportPrint();
|
||||||
bool unsetViewportPrint();
|
bool unsetViewportPrint();
|
||||||
|
|
|
@ -259,8 +259,8 @@ class FWidget : public FVTerm, public FObject
|
||||||
bool ignorePadding (bool); // ignore padding from
|
bool ignorePadding (bool); // ignore padding from
|
||||||
bool ignorePadding(); // the parent widget
|
bool ignorePadding(); // the parent widget
|
||||||
bool acceptPadding();
|
bool acceptPadding();
|
||||||
void setForegroundColor (FColor);
|
virtual void setForegroundColor (FColor);
|
||||||
void setBackgroundColor (FColor);
|
virtual void setBackgroundColor (FColor);
|
||||||
void setColor();
|
void setColor();
|
||||||
FWidgetFlags& setFlags();
|
FWidgetFlags& setFlags();
|
||||||
// Positioning and sizes mutators...
|
// Positioning and sizes mutators...
|
||||||
|
@ -285,9 +285,9 @@ class FWidget : public FVTerm, public FObject
|
||||||
void setMaximumHeight (std::size_t);
|
void setMaximumHeight (std::size_t);
|
||||||
void setMaximumSize (const FSize&);
|
void setMaximumSize (const FSize&);
|
||||||
void setFixedSize (const FSize&);
|
void setFixedSize (const FSize&);
|
||||||
bool setCursorPos (const FPoint&);
|
virtual bool setCursorPos (const FPoint&);
|
||||||
void unsetCursorPos();
|
void unsetCursorPos();
|
||||||
void setPrintPos (const FPoint&);
|
virtual void setPrintPos (const FPoint&);
|
||||||
void setDoubleFlatLine (fc::sides, bool = true);
|
void setDoubleFlatLine (fc::sides, bool = true);
|
||||||
void unsetDoubleFlatLine (fc::sides);
|
void unsetDoubleFlatLine (fc::sides);
|
||||||
void setDoubleFlatLine (fc::sides, int, bool = true);
|
void setDoubleFlatLine (fc::sides, int, bool = true);
|
||||||
|
|
Loading…
Reference in New Issue