Refactoring FDialog::initDialogMenu

This commit is contained in:
Markus Gans 2018-02-18 22:45:49 +01:00
parent 69956ce76f
commit 4322e957c9
3 changed files with 28 additions and 4 deletions

View File

@ -1,6 +1,7 @@
2017-02-18 Markus Gans <guru.mail@muenster.de>
* Avoid scroll bar overshooting
* Refactoring FListView::onMouseMove
* Refactoring FDialog::initDialogMenu
2017-02-17 Markus Gans <guru.mail@muenster.de>
* Generalize scroll functions in FTextView

View File

@ -179,6 +179,9 @@ class FDialog : public FWindow
// Methods
void init();
void initDialogMenu();
void initMoveSizeMenuItem (FMenu*);
void initZoomMenuItem (FMenu*);
void initCloseMenuItem (FMenu*);
virtual void drawBorder();
void drawTitleBar();
void drawBarButton();

View File

@ -925,9 +925,22 @@ void FDialog::initDialogMenu()
dgl_menuitem->unsetFocusable();
}
// Add the move/size menu item
initMoveSizeMenuItem (dialog_menu);
// Add the zoom menu item
initZoomMenuItem (dialog_menu);
// Add the close menu item
initCloseMenuItem (dialog_menu);
}
//----------------------------------------------------------------------
void FDialog::initMoveSizeMenuItem (FMenu* menu)
{
try
{
move_size_item = new FMenuItem (dialog_menu);
move_size_item = new FMenuItem (menu);
}
catch (const std::bad_alloc& ex)
{
@ -943,10 +956,14 @@ void FDialog::initDialogMenu()
"clicked",
F_METHOD_CALLBACK (this, &FDialog::cb_move)
);
}
//----------------------------------------------------------------------
void FDialog::initZoomMenuItem (FMenu* menu)
{
try
{
zoom_item = new FMenuItem (dialog_menu);
zoom_item = new FMenuItem (menu);
}
catch (const std::bad_alloc& ex)
{
@ -962,10 +979,14 @@ void FDialog::initDialogMenu()
"clicked",
F_METHOD_CALLBACK (this, &FDialog::cb_zoom)
);
}
//----------------------------------------------------------------------
void FDialog::initCloseMenuItem (FMenu* menu)
{
try
{
close_item = new FMenuItem ("&Close", dialog_menu);
close_item = new FMenuItem ("&Close", menu);
}
catch (const std::bad_alloc& ex)
{
@ -1067,7 +1088,6 @@ void FDialog::drawBarButton()
setReverse(true);
}
if ( isNewFont() )
{
print (fc::NF_rev_menu_button1);