本文整理汇总了C++中setResizable函数的典型用法代码示例。如果您正苦于以下问题:C++ setResizable函数的具体用法?C++ setResizable怎么用?C++ setResizable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setResizable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DocumentWindow
//==============================================================================
MainWindow::MainWindow()
: DocumentWindow (IntrojucerApp::getApp().getApplicationName(),
Colour::greyLevel (0.6f),
DocumentWindow::allButtons,
false)
{
setUsingNativeTitleBar (true);
createProjectContentCompIfNeeded();
#if ! JUCE_MAC
setMenuBar (IntrojucerApp::getApp().menuModel);
#endif
setResizable (true, false);
centreWithSize (800, 600);
ApplicationCommandManager& commandManager = IntrojucerApp::getCommandManager();
// Register all the app commands..
commandManager.registerAllCommandsForTarget (this);
commandManager.registerAllCommandsForTarget (getProjectContentComponent());
// update key mappings..
{
commandManager.getKeyMappings()->resetToDefaultMappings();
ScopedPointer <XmlElement> keys (getGlobalProperties().getXmlValue ("keyMappings"));
if (keys != nullptr)
commandManager.getKeyMappings()->restoreFromXml (*keys);
addKeyListener (commandManager.getKeyMappings());
}
// don't want the window to take focus when the title-bar is clicked..
setWantsKeyboardFocus (false);
getLookAndFeel().setColour (ColourSelector::backgroundColourId, Colours::transparentBlack);
setResizeLimits (600, 500, 32000, 32000);
}
示例2: TempDialogWindow
TempDialogWindow (const String& title,
Component* contentComponent_,
Component* componentToCentreAround,
const Colour& colour,
const bool escapeKeyTriggersCloseButton_,
const bool shouldBeResizable,
const bool useBottomRightCornerResizer,
const bool deleteContent = false)
: DialogWindow (title, colour, escapeKeyTriggersCloseButton_, true),
deleteDialog(deleteContent)
{
if (! JUCEApplication::isStandaloneApp())
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level
if(deleteContent)
setContentOwned (contentComponent_, true);
else
setContentNonOwned (contentComponent_, true);
centreAroundComponent (componentToCentreAround, getWidth(), getHeight());
setResizable (shouldBeResizable, useBottomRightCornerResizer);
}
示例3: PluginListWindow
PluginListWindow (MainHostWindow& owner_, AudioPluginFormatManager& pluginFormatManager)
: DocumentWindow ("Available Plugins",
LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId),
DocumentWindow::minimiseButton | DocumentWindow::closeButton),
owner (owner_)
{
const File deadMansPedalFile (getAppProperties().getUserSettings()
->getFile().getSiblingFile ("RecentlyCrashedPluginsList"));
setContentOwned (new PluginListComponent (pluginFormatManager,
owner.knownPluginList,
deadMansPedalFile,
getAppProperties().getUserSettings(), true), true);
setResizable (true, false);
setResizeLimits (300, 400, 800, 1500);
setTopLeftPosition (60, 60);
restoreWindowStateFromString (getAppProperties().getUserSettings()->getValue ("listWindowPos"));
setVisible (true);
}
示例4: ResizableWindow
//==============================================================================
FileChooserDialogBox::FileChooserDialogBox (const String& name,
const String& instructions,
FileBrowserComponent& chooserComponent,
const bool warnAboutOverwritingExistingFiles_,
const Colour& backgroundColour)
: ResizableWindow (name, backgroundColour, true),
warnAboutOverwritingExistingFiles (warnAboutOverwritingExistingFiles_)
{
content = new ContentComponent (name, instructions, chooserComponent);
setContentOwned (content, false);
setResizable (true, true);
setResizeLimits (300, 300, 1200, 1000);
content->okButton.addListener (this);
content->cancelButton.addListener (this);
content->newFolderButton.addListener (this);
content->chooserComponent.addListener (this);
FileChooserDialogBox::selectionChanged();
}
示例5: DocumentWindow
//==============================================================================
EdoFileEditor::EdoFileEditor (const File fileToEdit, const bool allowEditing)
: DocumentWindow (fileToEdit.getFullPathName(), Colours::white, DocumentWindow::allButtons, true)
{
//[UserPreSize]
editorComponent = new EdoFileEditorComponent (fileToEdit, allowEditing);
setContentComponent (editorComponent, true, true);
if (ApplicationProperties::getInstance()->getUserSettings()->getValue (T("fileEditorRectangle"), String::empty) != String::empty)
{
setBounds (Rectangle::fromString (ApplicationProperties::getInstance()->getUserSettings()->getValue (T("fileEditorRectangle"))));
}
else
{
centreWithSize (400, 400);
}
setResizable (true, true);
//[/UserPreSize]
//[Constructor] You can add your own custom stuff here..
//[/Constructor]
}
示例6: DocumentWindow
FileLocationEditorWindow::FileLocationEditorWindow(int posX, int posY,
ApplicationCommandManager* acm,
UndoManager& um)
: DocumentWindow("File Locations",
Colour::greyLevel(0.6f),
DocumentWindow::allButtons,
true)
{
setUsingNativeTitleBar (true);
setContentOwned(new FileLocationEditor(um, acm), true);
restoreWindowPosition(posX, posY);
Component::setVisible(true);
setResizable(true, false);
setWantsKeyboardFocus (false);
setResizeLimits(400, 200, 32000, 32000);
}
示例7: Window
OutfitWindow::OutfitWindow():
Window(_("Outfits")),
mBoxWidth(33),
mBoxHeight(33),
mGridWidth(3),
mGridHeight(3),
mItemClicked(false),
mItemMoved(NULL),
mItemSelected(-1),
mCurrentOutfit(0)
{
setWindowName("Outfits");
setResizable(true);
setCloseButton(true);
setDefaultSize(250, 250, 118, 180);
mPreviousButton = new Button(_("<"), "previous", this);
mNextButton = new Button(_(">"), "next", this);
mCurrentLabel = new Label(strprintf(_("Outfit: %d"), 1));
mCurrentLabel->setAlignment(gcn::Graphics::CENTER);
mUnequipCheck = new CheckBox(_("Unequip first"),
config.getValue("OutfitUnequip0", true));
mUnequipCheck->setActionEventId("unequip");
mUnequipCheck->addActionListener(this);
place(0, 3, mPreviousButton, 1);
place(1, 3, mCurrentLabel, 2);
place(3, 3, mNextButton, 1);
place(0, 4, mUnequipCheck, 4);
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
layout.setColWidth(4, Layout::CENTER);
loadWindowState();
load();
}
示例8: Window
DebugWindow::DebugWindow() :
// TRANSLATORS: debug window name
Window(_("Debug"), Modal_false, nullptr, "debug.xml"),
mTabs(CREATEWIDGETR(TabbedArea, this)),
mMapWidget(new MapDebugTab(this)),
mTargetWidget(new TargetDebugTab(this)),
mNetWidget(new NetDebugTab(this))
{
setWindowName("Debug");
if (setupWindow)
setupWindow->registerWindowForReset(this);
setResizable(true);
setCloseButton(true);
setSaveVisible(true);
setStickyButtonLock(true);
setDefaultSize(400, 300, ImagePosition::CENTER);
mTabs->setSelectable(false);
mTabs->getWidgetContainer()->setSelectable(false);
mTabs->getTabContainer()->setSelectable(false);
// TRANSLATORS: debug window tab
mTabs->addTab(std::string(_("Map")), mMapWidget);
// TRANSLATORS: debug window tab
mTabs->addTab(std::string(_("Target")), mTargetWidget);
// TRANSLATORS: debug window tab
mTabs->addTab(std::string(_("Net")), mNetWidget);
mTabs->setDimension(Rect(0, 0, 600, 300));
const int w = mDimension.width;
const int h = mDimension.height;
mMapWidget->resize(w, h);
mTargetWidget->resize(w, h);
mNetWidget->resize(w, h);
loadWindowState();
enableVisibleSound(true);
}
示例9: frameMargin
void pWindow::setGeometry(Geometry geometry) {
locked = true;
Application::processEvents();
QApplication::syncX();
Geometry margin = frameMargin();
setResizable(window.state.resizable);
qtWindow->move(geometry.x - frameMargin().x, geometry.y - frameMargin().y);
//qtWindow->adjustSize() fails if larger than 2/3rds screen size
qtWindow->resize(qtWindow->sizeHint());
if(window.state.resizable) {
//required to allow shrinking window from default size
qtWindow->setMinimumSize(1, 1);
qtContainer->setMinimumSize(1, 1);
}
for(auto& layout : window.state.layout) {
geometry.x = geometry.y = 0;
layout.setGeometry(geometry);
}
locked = false;
}
示例10: Window
Minimap::Minimap():
Window(_("Map")),
mMapImage(0),
mWidthProportion(0.5),
mHeightProportion(0.5)
{
setWindowName("MiniMap");
mShow = config.getValue(getWindowName() + "Show", true);
setDefaultSize(5, 25, 100, 100);
// set this to false as the minimap window size is changed
//depending on the map size
setResizable(false);
setDefaultVisible(true);
setSaveVisible(true);
setStickyButton(true);
setSticky(false);
loadWindowState();
setVisible(mShow, isSticky());
}
示例11: DocumentWindow
//==============================================================================
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);
}
示例12: setWindowName
ShortcutWindow::ShortcutWindow(const std::string &title,
ShortcutContainer *content)
{
setWindowName(title);
// no title presented, title bar is padding so window can be moved.
gcn::Window::setTitleBarHeight(gcn::Window::getPadding());
setShowTitle(false);
setResizable(true);
setDefaultVisible(false);
setSaveVisible(true);
setupWindow->registerWindowForReset(this);
mItems = content;
const int border = SCROLL_PADDING * 2 + getPadding() * 2;
setMinWidth(mItems->getBoxWidth() + border);
setMinHeight(mItems->getBoxHeight() + border);
setMaxWidth(mItems->getBoxWidth() * mItems->getMaxItems() + border);
setMaxHeight(mItems->getBoxHeight() * mItems->getMaxItems() + border);
setDefaultSize(mItems->getBoxWidth() + border, mItems->getBoxHeight() *
mItems->getMaxItems() + border, ImageRect::LOWER_RIGHT,
mBoxesWidth, 0);
mBoxesWidth += mItems->getBoxWidth() + border;
mScrollArea = new ScrollArea(mItems);
mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mScrollArea->setOpaque(false);
place(0, 0, mScrollArea, 5, 5).setPadding(0);
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
layout.setMargin(0);
loadWindowState();
}
示例13: Window
EmoteWindow::EmoteWindow() :
// TRANSLATORS: emotes window name
Window(_("Emotes"), Modal_false, nullptr, "emotes.xml"),
mTabs(CREATEWIDGETR(TabbedArea, this)),
mEmotePage(new EmotePage(this)),
mColorModel(ColorModel::createDefault(this)),
mColorPage(CREATEWIDGETR(ColorPage, this, mColorModel, "colorpage.xml")),
mScrollColorPage(new ScrollArea(this, mColorPage, Opaque_false,
"emotepage.xml")),
mFontModel(new NamesModel),
mFontPage(CREATEWIDGETR(ListBox, this, mFontModel, "")),
mScrollFontPage(new ScrollArea(this, mFontPage, Opaque_false,
"fontpage.xml")),
mImageSet(Theme::getImageSetFromThemeXml("emotetabs.xml", "", 17, 16))
{
setShowTitle(false);
setResizable(true);
if (setupWindow)
setupWindow->registerWindowForReset(this);
addMouseListener(this);
}
示例14: Window
StorageWindow::StorageWindow(int invSize):
Window(_("Storage")),
mMaxSlots(invSize),
mItemDesc(false)
{
setWindowName("Storage");
setResizable(true);
saveVisibility(false);
setCloseButton(true);
setDefaultSize(375, 300, ImageRect::CENTER);
mRetrieveButton = new Button(_("Retrieve"), "retrieve", this);
mRetrieveButton->setEnabled(false);
mCloseButton = new Button(_("Close"), "close", this);
mItems = new ItemContainer(player_node->getStorage(), "showpopupmenu", this);
mItems->addSelectionListener(this);
mInvenScroll = new ScrollArea(mItems);
mInvenScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mUsedSlots = player_node->getStorage()->getNumberOfSlotsUsed();
mSlotsLabel = new Label(_("Slots:"));
mSlotsBar = new ProgressBar(1.0f, 100, 20, gcn::Color(225, 200, 25));
mSlotsBar->setText(strprintf("%d/%d", mUsedSlots, mMaxSlots));
mSlotsBar->setProgress((float) mUsedSlots / mMaxSlots);
setMinHeight(130);
setMinWidth(200);
fontChanged();
loadWindowState();
}
示例15: Window
ShortcutWindow::ShortcutWindow(ShortcutContainer *content):
Window("", false, NULL, "graphics/gui/gui.xml", true)
{
// no title presented, title bar is padding so window can be moved.
gcn::Window::setTitleBarHeight(gcn::Window::getPadding());
setWindowName(content->getShortcutHandler()->getPrefix());
setShowTitle(false);
setResizable(true);
mItems = content;
const int border = SCROLL_PADDING * 2 + getPadding() * 2;
setMinWidth(mItems->getBoxWidth() + border);
setMinHeight(mItems->getBoxHeight() + border);
setMaxWidth(mItems->getBoxWidth() * mItems->getMaxShortcuts() + border);
setMaxHeight(mItems->getBoxHeight() * mItems->getMaxShortcuts() + border);
setDefaultSize(mItems->getBoxWidth() + border, (mItems->getBoxHeight() *
mItems->getMaxShortcuts()) + border, ImageRect::LOWER_RIGHT,
-mInstances * (mItems->getBoxWidth() + 2 * getPadding()), 0);
mInstances++;
mScrollArea = new ScrollArea(mItems);
mScrollArea->setPosition(SCROLL_PADDING, SCROLL_PADDING);
mScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mScrollArea->setOpaque(false);
place(0, 0, mScrollArea, 5, 5).setPadding(0);
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
layout.setMargin(0);
loadWindowState();
}