2017-11-04 07:03:53 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* menu.cpp - A menu example *
|
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* This file is part of the FINAL CUT widget toolkit *
|
2017-11-04 07:03:53 +01:00
|
|
|
* *
|
2020-02-02 22:34:27 +01:00
|
|
|
* Copyright 2015-2020 Markus Gans *
|
2017-11-04 07:03:53 +01:00
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* FINAL CUT is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Lesser General Public License as *
|
|
|
|
* published by the Free Software Foundation; either version 3 of *
|
2017-11-04 07:03:53 +01:00
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
* *
|
2020-07-08 21:32:47 +02:00
|
|
|
* FINAL CUT is distributed in the hope that it will be useful, but *
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
2017-11-04 07:03:53 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
|
|
* License along with this program. If not, see *
|
|
|
|
* <http://www.gnu.org/licenses/>. *
|
|
|
|
***********************************************************************/
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2017-10-31 00:41:59 +01:00
|
|
|
#include <final/final.h>
|
2015-12-18 21:48:27 +01:00
|
|
|
|
2019-04-26 21:06:04 +02:00
|
|
|
namespace fc = finalcut::fc;
|
2019-01-21 03:42:18 +01:00
|
|
|
using finalcut::FPoint;
|
|
|
|
using finalcut::FSize;
|
|
|
|
|
2015-12-08 21:05:00 +01:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// class Menu
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2020-04-14 23:46:42 +02:00
|
|
|
class Menu final : public finalcut::FDialog
|
2015-12-08 21:05:00 +01:00
|
|
|
{
|
2017-09-11 03:06:02 +02:00
|
|
|
public:
|
|
|
|
// Constructor
|
2018-12-10 01:48:26 +01:00
|
|
|
explicit Menu (finalcut::FWidget* = nullptr);
|
2018-12-24 18:11:16 +01:00
|
|
|
|
2018-12-09 22:04:55 +01:00
|
|
|
// Disable copy constructor
|
|
|
|
Menu (const Menu&) = delete;
|
2018-12-24 18:11:16 +01:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Destructor
|
2020-02-19 21:59:13 +01:00
|
|
|
~Menu() override;
|
2016-11-02 00:37:58 +01:00
|
|
|
|
2020-04-15 23:44:08 +02:00
|
|
|
// Disable copy assignment operator (=)
|
2018-12-09 22:04:55 +01:00
|
|
|
Menu& operator = (const Menu&) = delete;
|
2016-09-30 04:55:28 +02:00
|
|
|
|
2018-12-09 22:04:55 +01:00
|
|
|
private:
|
2017-09-11 03:06:02 +02:00
|
|
|
// Methods
|
2018-10-03 22:23:55 +02:00
|
|
|
void configureFileMenuItems();
|
|
|
|
void configureEditMenuItems();
|
|
|
|
void configureChoiceMenuItems();
|
|
|
|
void configureColorMenuItems();
|
|
|
|
void configureStyleMenuItems();
|
|
|
|
void configureBorderMenuItems();
|
2020-04-13 12:40:11 +02:00
|
|
|
void defaultCallback (const finalcut::FMenuList*);
|
2019-08-06 23:45:28 +02:00
|
|
|
void adjustSize() override;
|
2016-09-30 04:55:28 +02:00
|
|
|
|
2017-09-11 03:06:02 +02:00
|
|
|
// Event handler
|
2019-08-06 23:45:28 +02:00
|
|
|
void onClose (finalcut::FCloseEvent*) override;
|
2016-09-30 04:55:28 +02:00
|
|
|
|
2017-10-29 18:27:38 +01:00
|
|
|
// Callback method
|
2020-08-11 23:04:46 +02:00
|
|
|
void cb_message (finalcut::FMenuItem*);
|
2018-10-03 22:23:55 +02:00
|
|
|
|
2019-09-04 23:57:31 +02:00
|
|
|
// Data members
|
2019-04-26 21:06:04 +02:00
|
|
|
finalcut::FString line{13, fc::BoxDrawingsHorizontal};
|
2018-12-03 03:22:36 +01:00
|
|
|
finalcut::FMenuBar Menubar{this};
|
|
|
|
finalcut::FMenu File{"&File", &Menubar};
|
|
|
|
finalcut::FMenu Edit{"&Edit", &Menubar};
|
|
|
|
finalcut::FMenu Choice{"&Choice", &Menubar};
|
|
|
|
finalcut::FMenuItem Window{"&Window", &Menubar};
|
|
|
|
finalcut::FMenuItem Help{"&Help", &Menubar};
|
|
|
|
finalcut::FMenuItem New{"&New", &File};
|
|
|
|
finalcut::FMenuItem Open{"&Open...", &File};
|
|
|
|
finalcut::FMenuItem Save{"&Save", &File};
|
|
|
|
finalcut::FMenuItem SaveAs{"&Save as...", &File};
|
|
|
|
finalcut::FMenuItem Close{"&Close", &File};
|
|
|
|
finalcut::FMenuItem Line1{&File};
|
|
|
|
finalcut::FMenuItem Print{"&Print", &File};
|
|
|
|
finalcut::FMenuItem Line2{&File};
|
|
|
|
finalcut::FMenuItem Quit{"&Quit", &File};
|
2019-04-26 21:06:04 +02:00
|
|
|
finalcut::FMenuItem Undo{fc::Fckey_z, "&Undo", &Edit};
|
|
|
|
finalcut::FMenuItem Redo{fc::Fckey_y, "&Redo", &Edit};
|
2018-12-03 03:22:36 +01:00
|
|
|
finalcut::FMenuItem Line3{&Edit};
|
2019-04-26 21:06:04 +02:00
|
|
|
finalcut::FMenuItem Cut{fc::Fckey_x, "Cu&t", &Edit};
|
|
|
|
finalcut::FMenuItem Copy{fc::Fckey_c, "&Copy", &Edit};
|
|
|
|
finalcut::FMenuItem Paste{fc::Fckey_v, "&Paste", &Edit};
|
2018-12-03 03:22:36 +01:00
|
|
|
finalcut::FMenuItem Line4{&Edit};
|
2019-04-26 21:06:04 +02:00
|
|
|
finalcut::FMenuItem Search{fc::Fckey_f, "&Search", &Edit};
|
|
|
|
finalcut::FMenuItem Next{fc::Fkey_f3, "Search &next", &Edit};
|
2018-12-03 03:22:36 +01:00
|
|
|
finalcut::FMenuItem Line5{&Edit};
|
2019-04-26 21:06:04 +02:00
|
|
|
finalcut::FMenuItem SelectAll{fc::Fckey_a, "Select &all", &Edit};
|
2018-12-03 03:22:36 +01:00
|
|
|
finalcut::FMenu Color{"&Color", &Choice};
|
|
|
|
finalcut::FMenu Style{"&Style", &Choice};
|
|
|
|
finalcut::FMenu Border{"&Border", &Choice};
|
|
|
|
finalcut::FRadioMenuItem Color1{"Red", &Color};
|
|
|
|
finalcut::FRadioMenuItem Color2{"Green", &Color};
|
|
|
|
finalcut::FRadioMenuItem Color3{"Yellow", &Color};
|
|
|
|
finalcut::FRadioMenuItem Color4{"Brue", &Color};
|
|
|
|
finalcut::FRadioMenuItem Color5{"Black", &Color};
|
|
|
|
finalcut::FCheckMenuItem Bold{"Bold", &Style};
|
|
|
|
finalcut::FCheckMenuItem Italic{"Italic", &Style};
|
|
|
|
finalcut::FMenu BColor{"&Color", &Border};
|
|
|
|
finalcut::FMenu BStyle{"&Style", &Border};
|
|
|
|
finalcut::FRadioMenuItem BColor1{"Red", &BColor};
|
|
|
|
finalcut::FRadioMenuItem BColor2{"Blue", &BColor};
|
|
|
|
finalcut::FRadioMenuItem BStyle1{line, &BStyle};
|
|
|
|
finalcut::FRadioMenuItem BStyle2{"-------------", &BStyle};
|
|
|
|
finalcut::FRadioMenuItem BStyle3{"- - - - - - -", &BStyle};
|
|
|
|
finalcut::FRadioMenuItem BStyle4{"- - - - -", &BStyle};
|
|
|
|
finalcut::FStatusBar Statusbar{this};
|
|
|
|
finalcut::FLabel Headline1{this};
|
|
|
|
finalcut::FLabel Headline2{this};
|
|
|
|
finalcut::FLabel Info{this};
|
2015-12-08 21:05:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
Menu::Menu (finalcut::FWidget* parent)
|
2020-05-24 23:55:08 +02:00
|
|
|
: finalcut::FDialog{parent}
|
2015-12-08 21:05:00 +01:00
|
|
|
{
|
2018-10-03 22:23:55 +02:00
|
|
|
// Menu bar itms
|
|
|
|
File.setStatusbarMessage ("File management commands");
|
|
|
|
Edit.setStatusbarMessage ("Cut-and-paste editing commands");
|
|
|
|
Choice.setStatusbarMessage ("Choice menu");
|
|
|
|
Window.setDisable();
|
|
|
|
Help.setStatusbarMessage ("Show version and copyright information");
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-01-21 16:21:41 +01:00
|
|
|
// Menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
configureFileMenuItems();
|
|
|
|
configureEditMenuItems();
|
|
|
|
configureChoiceMenuItems();
|
2018-01-21 16:21:41 +01:00
|
|
|
|
|
|
|
// Add default menu item callback
|
2018-10-03 22:23:55 +02:00
|
|
|
defaultCallback (&Menubar);
|
2018-01-21 16:21:41 +01:00
|
|
|
|
|
|
|
// Statusbar at the bottom
|
2018-10-03 22:23:55 +02:00
|
|
|
Statusbar.setMessage("Status bar message");
|
2018-01-21 16:21:41 +01:00
|
|
|
|
|
|
|
// Headline labels
|
2018-10-03 22:23:55 +02:00
|
|
|
Headline1 << " Key ";
|
|
|
|
Headline1.ignorePadding();
|
2020-05-02 00:07:35 +02:00
|
|
|
Headline1.setGeometry(FPoint{3, 2}, FSize{5, 1});
|
2018-10-03 22:23:55 +02:00
|
|
|
Headline1.setEmphasis();
|
2018-01-21 16:21:41 +01:00
|
|
|
|
2018-10-03 22:23:55 +02:00
|
|
|
Headline2 << " Function ";
|
|
|
|
Headline2.ignorePadding();
|
2020-05-02 00:07:35 +02:00
|
|
|
Headline2.setGeometry(FPoint{19, 2}, FSize{10, 1});
|
2018-10-03 22:23:55 +02:00
|
|
|
Headline2.setEmphasis();
|
2018-01-21 16:21:41 +01:00
|
|
|
|
|
|
|
// Info label
|
2018-10-03 22:23:55 +02:00
|
|
|
Info << "<F10> Activate menu bar\n"
|
|
|
|
<< "<Ctrl>+<Space> Activate menu bar\n"
|
|
|
|
<< "<Meta>+<X> Exit";
|
2020-05-02 00:07:35 +02:00
|
|
|
Info.setGeometry(FPoint{2, 1}, FSize{36, 3});
|
2018-01-21 16:21:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
Menu::~Menu()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureFileMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "File" menu items
|
2019-04-26 21:06:04 +02:00
|
|
|
New.addAccelerator (fc::Fckey_n); // Ctrl + N
|
2018-10-03 22:23:55 +02:00
|
|
|
New.setStatusbarMessage ("Create a new file");
|
2019-04-26 21:06:04 +02:00
|
|
|
Open.addAccelerator (fc::Fckey_o); // Ctrl + O
|
2018-10-03 22:23:55 +02:00
|
|
|
Open.setStatusbarMessage ("Locate and open a text file");
|
2019-04-26 21:06:04 +02:00
|
|
|
Save.addAccelerator (fc::Fckey_s); // Ctrl + S
|
2018-10-03 22:23:55 +02:00
|
|
|
Save.setStatusbarMessage ("Save the file");
|
|
|
|
SaveAs.setStatusbarMessage ("Save the current file under a different name");
|
2019-04-26 21:06:04 +02:00
|
|
|
Close.addAccelerator (fc::Fckey_w); // Ctrl + W
|
2018-10-03 22:23:55 +02:00
|
|
|
Close.setStatusbarMessage ("Close the current file");
|
|
|
|
Line1.setSeparator();
|
2019-04-26 21:06:04 +02:00
|
|
|
Print.addAccelerator (fc::Fckey_p); // Ctrl + P
|
2018-10-03 22:23:55 +02:00
|
|
|
Print.setStatusbarMessage ("Print the current file");
|
|
|
|
Line2.setSeparator();
|
2019-04-26 21:06:04 +02:00
|
|
|
Quit.addAccelerator (fc::Fmkey_x); // Meta/Alt + X
|
2018-10-03 22:23:55 +02:00
|
|
|
Quit.setStatusbarMessage ("Exit the program");
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-01-21 16:21:41 +01:00
|
|
|
// Add quit menu item callback
|
2018-10-03 22:23:55 +02:00
|
|
|
Quit.addCallback
|
2018-01-21 16:21:41 +01:00
|
|
|
(
|
|
|
|
"clicked",
|
2020-08-11 23:04:46 +02:00
|
|
|
finalcut::getFApplication(),
|
|
|
|
&finalcut::FApplication::cb_exitApp,
|
|
|
|
this
|
2018-01-21 16:21:41 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureEditMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "Edit" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
Undo.setStatusbarMessage ("Undo the previous operation");
|
|
|
|
Redo.setDisable();
|
|
|
|
Line3.setSeparator();
|
|
|
|
Cut.setStatusbarMessage ( "Remove the input text "
|
|
|
|
"and put it in the clipboard" );
|
|
|
|
Copy.setStatusbarMessage ("Copy the input text into the clipboad");
|
|
|
|
Paste.setStatusbarMessage ("Insert text form clipboard");
|
|
|
|
Line4.setSeparator();
|
|
|
|
Search.setStatusbarMessage ("Search for text");
|
|
|
|
Next.setStatusbarMessage ("Repeat the last search command");
|
|
|
|
Line5.setSeparator();
|
|
|
|
SelectAll.setStatusbarMessage ("Select the whole text");
|
2018-01-21 16:21:41 +01:00
|
|
|
}
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-01-21 16:21:41 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureChoiceMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "Choice" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
Color.setStatusbarMessage ("Choose a color");
|
|
|
|
Style.setStatusbarMessage ("Choose a Style");
|
|
|
|
Border.setStatusbarMessage ("Choose Border");
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-10-03 22:23:55 +02:00
|
|
|
configureColorMenuItems();
|
|
|
|
configureStyleMenuItems();
|
|
|
|
configureBorderMenuItems();
|
2018-01-21 16:21:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureColorMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "Color" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
Color1.setStatusbarMessage ("Set text red");
|
|
|
|
Color2.setStatusbarMessage ("Set text green");
|
|
|
|
Color3.setStatusbarMessage ("Set text yellow");
|
|
|
|
Color4.setStatusbarMessage ("Set text brue");
|
|
|
|
Color5.setStatusbarMessage ("Set text black");
|
|
|
|
Color5.setChecked();
|
2018-01-21 16:21:41 +01:00
|
|
|
}
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-01-21 16:21:41 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureStyleMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "Style" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
Bold.setStatusbarMessage ("Set text bold");
|
|
|
|
Italic.setStatusbarMessage ("Set text italic");
|
2018-01-21 16:21:41 +01:00
|
|
|
}
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2018-01-21 16:21:41 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-10-03 22:23:55 +02:00
|
|
|
void Menu::configureBorderMenuItems()
|
2018-01-21 16:21:41 +01:00
|
|
|
{
|
2015-12-08 21:05:00 +01:00
|
|
|
// "Border" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
BColor.setStatusbarMessage ("Choose the border color");
|
|
|
|
BStyle.setStatusbarMessage ("Choose the border Style");
|
2015-12-08 21:05:00 +01:00
|
|
|
|
|
|
|
// "BColor" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
BColor1.setStatusbarMessage ("Set red border");
|
|
|
|
BColor2.setStatusbarMessage ("Set blue border");
|
2015-12-08 21:05:00 +01:00
|
|
|
|
|
|
|
// "BStyle" menu items
|
2018-10-03 22:23:55 +02:00
|
|
|
BStyle1.setChecked();
|
|
|
|
BStyle1.setStatusbarMessage ("Set border 1");
|
|
|
|
BStyle2.setStatusbarMessage ("Set border 2");
|
|
|
|
BStyle3.setStatusbarMessage ("Set border 3");
|
|
|
|
BStyle4.setStatusbarMessage ("Set border 4");
|
2015-12-08 21:05:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2020-04-13 12:40:11 +02:00
|
|
|
void Menu::defaultCallback (const finalcut::FMenuList* mb)
|
2015-12-18 21:48:27 +01:00
|
|
|
{
|
2019-08-25 22:16:00 +02:00
|
|
|
for (uInt i{1}; i <= mb->getCount(); i++)
|
2015-12-18 21:48:27 +01:00
|
|
|
{
|
2018-12-15 00:50:09 +01:00
|
|
|
auto item = mb->getItem(int(i));
|
2015-12-18 21:48:27 +01:00
|
|
|
|
2016-12-18 23:34:11 +01:00
|
|
|
if ( item
|
2017-11-26 22:37:18 +01:00
|
|
|
&& item->isEnabled()
|
|
|
|
&& item->acceptFocus()
|
|
|
|
&& item->isVisible()
|
|
|
|
&& ! item->isSeparator()
|
|
|
|
&& item->getText() != "&Quit" )
|
2015-12-18 21:48:27 +01:00
|
|
|
{
|
|
|
|
// Add the callback function
|
|
|
|
item->addCallback
|
|
|
|
(
|
|
|
|
"clicked",
|
2020-08-11 23:04:46 +02:00
|
|
|
this, &Menu::cb_message,
|
|
|
|
item
|
2015-12-18 21:48:27 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
// Call sub-menu
|
|
|
|
if ( item->hasMenu() )
|
|
|
|
defaultCallback (item->getMenu());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-02 00:37:58 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
void Menu::adjustSize()
|
|
|
|
{
|
2020-02-02 22:34:27 +01:00
|
|
|
const int pw = int(getDesktopWidth());
|
|
|
|
const int ph = int(getDesktopHeight());
|
2018-10-14 06:25:33 +02:00
|
|
|
setX (1 + (pw - int(getWidth())) / 2, false);
|
|
|
|
setY (1 + (ph - int(getHeight())) / 4, false);
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FDialog::adjustSize();
|
2016-11-02 00:37:58 +01:00
|
|
|
}
|
|
|
|
|
2015-12-08 21:05:00 +01:00
|
|
|
//----------------------------------------------------------------------
|
2018-09-20 23:59:01 +02:00
|
|
|
void Menu::onClose (finalcut::FCloseEvent* ev)
|
2015-12-08 21:05:00 +01:00
|
|
|
{
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FApplication::closeConfirmationDialog (this, ev);
|
2015-12-08 21:05:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2020-08-11 23:04:46 +02:00
|
|
|
void Menu::cb_message (finalcut::FMenuItem* menuitem)
|
2015-12-08 21:05:00 +01:00
|
|
|
{
|
2018-12-15 00:50:09 +01:00
|
|
|
auto text = menuitem->getText();
|
2015-12-08 21:05:00 +01:00
|
|
|
text = text.replace('&', "");
|
2018-09-20 23:59:01 +02:00
|
|
|
finalcut::FMessageBox::info ( this
|
|
|
|
, "Info"
|
|
|
|
, "You have chosen \"" + text + "\"" );
|
2015-12-08 21:05:00 +01:00
|
|
|
}
|
|
|
|
|
2015-12-18 21:48:27 +01:00
|
|
|
|
2015-12-08 21:05:00 +01:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// main part
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
int main (int argc, char* argv[])
|
|
|
|
{
|
2017-09-19 06:18:03 +02:00
|
|
|
// Create the application object
|
2020-05-02 00:07:35 +02:00
|
|
|
finalcut::FApplication app {argc, argv};
|
2015-12-08 21:05:00 +01:00
|
|
|
|
2017-09-19 06:18:03 +02:00
|
|
|
// Create main dialog object
|
2020-05-02 00:07:35 +02:00
|
|
|
Menu main_dlg {&app};
|
2015-12-08 21:05:00 +01:00
|
|
|
main_dlg.setText ("Menu example");
|
2020-05-02 00:07:35 +02:00
|
|
|
main_dlg.setGeometry ( FPoint{int(1 + (app.getWidth() - 40) / 2), 2}
|
|
|
|
, FSize{40, 6} );
|
2015-12-08 21:05:00 +01:00
|
|
|
main_dlg.setShadow();
|
|
|
|
|
2017-09-19 06:18:03 +02:00
|
|
|
// Set dialog main_dlg as main widget
|
2020-04-13 12:40:11 +02:00
|
|
|
finalcut::FWidget::setMainWidget (&main_dlg);
|
2017-09-19 06:18:03 +02:00
|
|
|
|
|
|
|
// Show and start the application
|
2015-12-08 21:05:00 +01:00
|
|
|
main_dlg.show();
|
|
|
|
return app.exec();
|
|
|
|
}
|