void FTitleBar::initUI() { setTitleBarHeight(Title_Height); setLogoButton(":/skin/images/QFramer.png", "Logo"); setTitleLabel(tr("QFramer"), "TitleLabel"); setSettingButton(":/skin/icons/dark/appbar.control.down.png"); setSkinButton(":/skin/icons/dark/appbar.clothes.shirt.png"); setMinButton(":/skin/icons/dark/appbar.minus.png"); setMaxButton(":/skin/icons/dark/appbar.app.png"); setCloseButton(":/skin/icons/dark/appbar.close.png", "close"); QHBoxLayout* mainlayout = new QHBoxLayout; mainlayout->addWidget(logoButton); mainlayout->addWidget(titleLabel); mainlayout->addStretch(); mainlayout->addWidget(settingButton); mainlayout->addWidget(skinButton); mainlayout->addWidget(minButton); mainlayout->addWidget(maxButton); mainlayout->addWidget(closeButton); mainlayout->setContentsMargins(0, 0, 5, 0); mainlayout->setSpacing(0); setLayout(mainlayout); settingMenu = new FSettingMenu; setSettingMenu(settingMenu); }
NpcDialog::NpcDialog(): XWindow(), gcn::ActionListener() { setBaseColor(gcn::Color(190, 208, 247, 128)); setPadding(3); setSize(300, 400); //setAlignment(gcn::Graphics::LEFT); setShowCloseBtn(true); setVisible(true); setTitleBarHeight(25); mTextBox = new XTextBox(); mTextBox->setWidth(300); mTextBox->setTextWrapped("你好,小伙子。你能帮我挑点水么?我老了,干不动体力活儿了。如果你能帮助我,我会给你一些奖励的。"); mTextBox->setEditable(false); this->add(mTextBox, 0, 0); mListBox = new XListBox(); mListModel = new XListModel(); mListModel->addElement("好的。"); mListModel->addElement("不了,谢谢!"); mListBox->setListModel(mListModel); this->add(mListBox, 0, mTextBox->getHeight() + 20); }
void Window::fontChanged() { std::list<Widget*>::iterator iter; for (iter = mWidgets.begin(); iter != mWidgets.end(); ++iter) (*iter)->fontChanged(); if (!getCaption().empty()) setTitleBarHeight(getFont()->getHeight() + 10); }
MainWindow() : DocumentWindow ("Roomote", Colours::black, 0) { setContentOwned (new MainContentComponent(), false); setTitleBarHeight(0); centreWithSize (322, 242); // Not sure why 2 more pixels need to be added setVisible (true); }
Window::Window() :mMoved(false) { setFrameSize(1); setPadding(2); setTitleBarHeight(16); setAlignment(Graphics::CENTER); addMouseListener(this); setMovable(true); setOpaque(true); }
//============================================================================== VstPluginWindow::VstPluginWindow (PluginEditorWindowHolder* owner_, BasePlugin* plugin_) : DialogWindow (String::empty, Colours::beige, true, false), plugin (0), owner (owner_), specialEditor (0), nativeEditor (0), externalEditor (0), content (0) { DBG ("VstPluginWindow::VstPluginWindow"); // add to desktop addToDesktop (getDesktopWindowStyleFlags()); // setup window default values setTitleBarHeight (24); centreWithSize (400, 300); setWantsKeyboardFocus (true); setBackgroundColour (Config::getInstance ()->getColour (T("mainBackground"))); // try to move the window to its old position int oldX = -1, oldY = -1, oldW = -1, oldH = -1, lastPage = 0; if (plugin_) { oldX = plugin_->getIntValue (PROP_WINDOWXPOS, -1); oldY = plugin_->getIntValue (PROP_WINDOWYPOS, -1); oldW = plugin_->getIntValue (PROP_WINDOWWSIZE, -1); oldH = plugin_->getIntValue (PROP_WINDOWHSIZE, -1); lastPage = plugin_->getIntValue (PROP_WINDOWPAGE, 0); } // try to move the window to its old position if (oldX >= 0 && oldY >= 0) setTopLeftPosition (oldX, oldY); // try to set the window to its old size if ((lastPage == 0 && ! externalEditor) || (lastPage == 1 && externalEditor)) { if (oldW >= 0 && oldY >= 0) setSize (oldW, oldH); } // default plugin to open setPlugin (plugin_); // setMenuBar here, after setting the plugin, so the plugin's menu items are there immediately setMenuBar (this, getMenuBarHeight ()); // restore window to front toFront (false); setVisible (true); }
Window::Window(const std::string& caption) :mIsMoving(false) { setCaption(caption); setBorderSize(1); setPadding(2); setTitleBarHeight(16); setAlignment(Graphics::CENTER); addMouseListener(this); setMovable(true); setOpaque(true); }
Window::Window(const std::string& caption) :mMoved(false) { setCaption(caption); setFrameSize(1); setPadding(2); setTitleBarHeight(16); setAlignment(Graphics::Center); addMouseListener(this); setMovable(true); setOpaque(true); }
Window::Window(const std::string& caption, bool modal, Window *parent, const std::string& skin, bool visible): gcn::Window(caption), mOldVisibility(false), mGrip(NULL), mClose(NULL), mParent(parent), mLayout(NULL), mWindowName("window"), mDefaultSkinPath(skin), mShowTitle(true), mModal(modal), mDefaultVisible(visible), mSaveVisibility(true), mHasMaxDimensions(false), mMinWinWidth(100), mMinWinHeight(40), mMaxWinWidth(graphics->getWidth()), mMaxWinHeight(graphics->getHeight()) { logger->log("Window::Window(\"%s\")", caption.c_str()); if (!windowContainer) throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); if (!skinLoader) skinLoader = new SkinLoader(); instances++; setFrameSize(0); setPadding(3); setTitleBarHeight(20); // Loads the skin mSkin = skinLoader->load(skin, mDefaultSkinPath); // Add this window to the window container windowContainer->add(this); if (mModal) { gui->setCursorType(Gui::CURSOR_POINTER); requestModalFocus(); } // Windows are invisible by default setVisible(false); addWidgetListener(this); }
//============================================================================== HelloWorldWindow() : DocumentWindow (ProjectInfo::projectName + String(" ") + ProjectInfo::versionString, Colours::lightgrey, DocumentWindow::allButtons, true) { setTitleBarHeight(30); // Create an instance of our main content component, and add it to our window.. setContentOwned (new MainTabs(), true); // Centre the window on the screen centreWithSize (900, 750); // And show it! setVisible (true); }
void EmoteWindow::postInit() { Window::postInit(); const int pad2 = mPadding * 2; const int width = 200; const int height = 150; setWidth(width + pad2); setHeight(height + pad2); add(mTabs); mTabs->setPosition(mPadding, mPadding); mTabs->setWidth(width); mTabs->setHeight(height); center(); setTitleBarHeight(getPadding() + getTitlePadding()); mScrollColorPage->setVerticalScrollPolicy(ScrollArea::SHOW_ALWAYS); mScrollColorPage->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); mScrollFontPage->setVerticalScrollPolicy(ScrollArea::SHOW_NEVER); mScrollFontPage->setHorizontalScrollPolicy(ScrollArea::SHOW_NEVER); mFontModel->fillFromArray(&fontSizeList[0], fontSizeListSize); mFontPage->setCenter(true); if (mImageSet && mImageSet->size() >= 3) { for (int f = 0; f < 3; f ++) { Image *const image = mImageSet->get(f); if (image) image->incRef(); } mTabs->addTab(mImageSet->get(0), mEmotePage); mTabs->addTab(mImageSet->get(2), mScrollColorPage); mTabs->addTab(mImageSet->get(1), mScrollFontPage); } else { // TRANSLATORS: emotes tab name mTabs->addTab(_("Emotes"), mEmotePage); // TRANSLATORS: emotes tab name mTabs->addTab(_("Colors"), mScrollColorPage); // TRANSLATORS: emotes tab name mTabs->addTab(_("Fonts"), mScrollFontPage); } mEmotePage->setActionEventId("emote"); mColorPage->setActionEventId("color"); mFontPage->setActionEventId("font"); }
MainWindow(const String &commandLine) : DocumentWindow ("Sunrise",Colours::lightgrey,DocumentWindow::allButtons) { jobManager = new SunriseJobManager(commandLine.isEmpty() ? File::getSpecialLocation(File::userHomeDirectory).getChildFile(".sunriserc") : File(commandLine)); setUsingNativeTitleBar(true); #ifdef LINUX_RPI setUsingNativeTitleBar (false); setTitleBarHeight (0); setFullScreen (true); #endif setContentOwned (new SunriseMain(*jobManager), true); centreWithSize (getWidth(), getHeight()); setVisible (true); }
MacVSTGUIPositionHelperWindow::MacVSTGUIPositionHelperWindow(BasePlugin* plugin_, int topleftX, int topleftY) : DocumentWindow (T(""), Colours::floralwhite, false), plugin(plugin_) { setTitleBarHeight(0); setResizable (false, false); int editorWidth; int editorHeight; plugin->getEditorSize (editorWidth, editorHeight); setSize(editorWidth, editorHeight); setTopLeftPosition(topleftX, topleftY); setVisible (true); }
ThorConfigDialog::ThorConfigDialog(ThorConfig *_config, Component *content) : DialogWindow (T("Options"), Colours::white, true, true) { config = _config; if (content) { setContentComponent (content); setName (content->getName()); } else setContentComponent (configComponent = new ThorConfigComponent(config)); setTitleBarHeight (16); enterModalState (true); setVisible (true); setAlwaysOnTop(true); }
//============================================================================== MainAppWindow::MainAppWindow() : DocumentWindow ( "UGen++", // Set the text to use for the title Colours::azure, // Set the colour of the window DocumentWindow::allButtons, // Set which buttons are displayed true // This window should be added to the desktop ) { setResizable (true, false); setTitleBarHeight (22); MainComponent* contentComponent = new MainComponent (); setContentOwned (contentComponent, false); }
//============================================================================== HelloWorldWindow() : DocumentWindow (T("XML-RPC testing"), Colours::lightgrey, DocumentWindow::allButtons, true) { // Create an instance of our main content component, and add it // to our window. MainComponent* const contentComponent = new MainComponent(); setContentComponent (contentComponent, true, true); centreWithSize (getWidth(), getHeight()); setResizable (false, false); setTitleBarHeight (23); setVisible (true); }
LoadingWindow::LoadingWindow() : DocumentWindow (String::empty, Colours::lightgrey, 0, false) { loadingComponent = new LoadingComponent(); addToDesktop(getDesktopWindowStyleFlags()); setTitleBarHeight(0); //set loading component to own the content of the loading window setContentOwned(loadingComponent, false); centreWithSize (500, 200); toFront(true); setVisible (true); }
ConnectionDialog::ConnectionDialog(const std::string &text, State cancelState): Window(""), mCancelState(cancelState) { setTitleBarHeight(0); setMovable(false); setMinWidth(0); ProgressIndicator *progressIndicator = new ProgressIndicator; gcn::Label *label = new Label(text); Button *cancelButton = new Button(_("Cancel"), "cancelButton", this); place(0, 0, progressIndicator); place(0, 1, label); place(0, 2, cancelButton).setHAlign(LayoutCell::CENTER); reflowLayout(); center(); setVisible(true); }
//============================================================================== MainAppWindow::MainAppWindow() : // Initialise the base 'DocumentWindow'... DocumentWindow ( "The Melody Stochaster", // Set the text to use for the title Colours::azure, // Set the colour of the window DocumentWindow::allButtons, // Set which buttons are displayed true // This window should be added to the desktop ) { setResizable (false, false); setTitleBarHeight (22); // create the main component, which is described in MainComponent.h MainComponent* contentComponent = new MainComponent (); // This sets the main content component for the window to be whatever MainComponent // is. The nature of DocumentWindow means that the contentComponent will fill the main // area of the window, and will be deleted automatically when the window is deleted. setContentOwned (contentComponent, false); }
ConnectionDialog::ConnectionDialog(const std::string &text, const State cancelState): Window(""), gcn::ActionListener(), mCancelState(cancelState) { setTitleBarHeight(0); setMovable(false); setMinWidth(0); ProgressIndicator *const progressIndicator = new ProgressIndicator; Label *const label = new Label(this, text); Button *const cancelButton = new Button( // TRANSLATORS: connection dialog button this, _("Cancel"), "cancelButton", this); place(0, 0, progressIndicator); place(0, 1, label); place(0, 2, cancelButton).setHAlign(LayoutCell::CENTER); reflowLayout(); center(); }
//============================================================================== MainAppWindow::MainAppWindow(ApplicationCommandManager* commandManager) : // Initialise the base 'DocumentWindow'... DocumentWindow ( T("MyJuceApp"), Colours::lightgrey, DocumentWindow::allButtons, true ) { setResizable (true, false); // resizability is a property of ResizableWindow, which is setTitleBarHeight (25); // Set the height of the titlebar on our window. MainComponent* contentComponent = new MainComponent (this, commandManager); setContentComponent (contentComponent); #if defined(LINUX) setMenuBar(contentComponent); #endif //setMenuBar(setMacMainMenu(contentComponent)); }
vmain::vmain() : img(NULL){ setSize(283,342); setPosition(800/2-283/2,600/2-342/2); setMovable(false); setTitleBarHeight(0); setPadding(0); setFocusable(false); login_added=false; /*puerto= new _TextField("7666",gcn::Graphics::CENTER); puerto->setSize(133,14); puerto->setBackgroundColor(gcn::Color(0,0,0,0)); puerto->setForegroundColor(gcn::Color(255,255,255,255)); puerto->setBorderSize(0); add(puerto,200,163);*/ /*host= new _TextField("testserver.aonx.com.ar",gcn::Graphics::CENTER); host->setSize(208,14); host->setBackgroundColor(gcn::Color(0,0,0,0)); host->setForegroundColor(gcn::Color(255,255,255,255)); host->setBorderSize(0); add(host,366,163);*/ /*blogin = new NoDrawButton; blogin->setSize(230,80); blogin->setFocusable(false); blogin->setActionEventId("blogin"); blogin->addActionListener(this); add(blogin,560,340);*/ /*bcreate = new NoDrawButton; bcreate->setSize(230,80); bcreate->setFocusable(false); bcreate->setActionEventId("CREATE"); bcreate->addActionListener(ClienteArgentum::instancia()); add(bcreate,560,440);*/ login_button = new ImageButton(); create_button = new ImageButton(); servers_button = new ImageButton(); options_button = new ImageButton(); exit_button = new ImageButton(); login_button->setSize(250, 40); create_button->setSize(250, 40); servers_button->setSize(250, 40); options_button->setSize(250, 40); exit_button->setSize(250, 40); std::string path; path=ConfigData::GetPath("gui") + std::string("main_menu/"); login_button->setNormalImage(path + std::string("login.png")); login_button->setMoserOverImage(path + std::string("loginb.png")); login_button->setActionEventId("LOGIN_DIALOG"); login_button->addActionListener(ClienteArgentum::instancia()); create_button->setNormalImage(path + std::string("create.png")); create_button->setMoserOverImage(path + std::string("createb.png")); create_button->setActionEventId("CREATE"); create_button->addActionListener(ClienteArgentum::instancia()); servers_button->setNormalImage(path + std::string("servers.png")); servers_button->setMoserOverImage(path + std::string("serversb.png")); options_button->setNormalImage(path + std::string("opciones.png")); options_button->setMoserOverImage(path + std::string("opcionesb.png")); options_button->setActionEventId("OPTIONS"); options_button->addActionListener(ClienteArgentum::instancia()); exit_button->setNormalImage(path + std::string("salir.png")); exit_button->setMoserOverImage(path + std::string("salirb.png")); exit_button->setActionEventId("EXIT"); exit_button->addActionListener(ClienteArgentum::instancia()); add(login_button,17, 66); add(create_button,17, 121); add(servers_button,17, 176); add(options_button,17, 231); add(exit_button,17, 287); }
Windowiki::Windowiki(const std::string& caption, bool modal, Windowiki *parent): gcn::Window(caption), mGrip(0), mParent(parent), mWindowName("Window iki"), mShowTitle(true), mModal(modal), mResizable(true), mMouseResize(0), mSticky(false), mMinWinWidth(125), mMinWinHeight(250), mMaxWinWidth(INT_MAX), mMaxWinHeight(INT_MAX), mCloseButton(false) { if (!windowikiContainer) { throw GCN_EXCEPTION("Window::Window. no windowContainer set"); } if (instancesiki == 0) { // Load static resources ResourceManager *resman = ResourceManager::getInstance(); Image *dBorders = resman->getImage("graphics/gui/ppp.png"); borderiki.grid[0] = dBorders->getSubImage(0, 0, 15, 24); //sol üst taraf borderiki.grid[1] = dBorders->getSubImage(50, 0, 5, 48); //üst tarafýn devamlýlýðý borderiki.grid[2] = dBorders->getSubImage(15, 0, 15, 25); // sað üst taraf borderiki.grid[3] = dBorders->getSubImage(0, 110, 44, 5); // sol taraf devamlýlýk borderiki.grid[4] = resman->getImage("graphics/gui/ff.png"); borderiki.grid[5] = dBorders->getSubImage(115, 210, 42, 10); // sað taraf devamlýlýk borderiki.grid[6] = dBorders->getSubImage(0, 30, 15, 30); //sol alt taraf borderiki.grid[7] = dBorders->getSubImage(89, 0, 5, 61); //alt taraf devamlýlýk borderiki.grid[8] = dBorders->getSubImage(0, 15, 0, 55); //sað alt taraf dBorders->decRef(); closeImage = resman->getImage("graphics/gui/close_button.png"); solustImage = resman->getImage("graphics/gui/solust.png"); sagustImage = resman->getImage("graphics/gui/sagust.png"); solaltImage = resman->getImage("graphics/gui/solalt.png"); sagaltImage = resman->getImage("graphics/gui/sagalt.png"); windowikiConfigListener = new WindowikiConfigListener(); // Send GUI alpha changed for initialization //þeffaf pencereyi kapattým. // windowikiConfigListener->optionChanged("guialpha"); // config.addListener("guialpha", windowikiConfigListener); } instancesiki++; setPadding(5); setTitleBarHeight(30); // Add chrome // mChrome = new GCContainer(); // mChrome->setOpaque(false); // gcn::Window::add(mChrome); // Add this window to the window container windowikiContainer->add(this); if (mModal) { requestModalFocus(); } // Windows are invisible by default setVisible(false); }