本文整理汇总了C++中SetSize函数的典型用法代码示例。如果您正苦于以下问题:C++ SetSize函数的具体用法?C++ SetSize怎么用?C++ SetSize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSize
void Widget::SetDimensions(const Point &position, const Point &size)
{
m_position = position;
SetSize(size);
SetActiveArea(size);
}
示例2: SetSize
/**
* \brief Set the size of the widget
*/
void MythUIImage::SetSize(int width, int height)
{
SetSize(QSize(width,height));
}
示例3: Create
ApplicationFolder::ApplicationFolder(wxWizard* parent, wxWizardPageSimple* prev, wxWizardPageSimple* next)
{
//(*Initialize(ApplicationFolder)
wxBoxSizer* BoxSizer4;
wxBoxSizer* BoxSizer6;
wxBoxSizer* BoxSizer19;
wxBoxSizer* BoxSizer5;
wxBoxSizer* BoxSizer10;
wxBoxSizer* BoxSizer7;
wxBoxSizer* BoxSizer8;
wxStaticText* StaticText2;
wxBoxSizer* BoxSizer13;
wxStaticBitmap* StaticBitmap1;
wxStaticText* StaticText8;
wxStaticText* StaticText1;
wxBoxSizer* BoxSizer2;
wxBoxSizer* BoxSizer11;
wxBoxSizer* BoxSizer12;
wxBoxSizer* BoxSizer14;
wxStaticText* StaticText5;
wxStaticText* StaticText7;
wxBoxSizer* BoxSizer1;
wxBoxSizer* BoxSizer9;
wxBoxSizer* BoxSizer3;
Create(parent, prev, next);
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
Panel1->SetBackgroundColour( wxColour( 255, 255, 255));
BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer5 = new wxBoxSizer(wxVERTICAL);
BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer6->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText2 = new wxStaticText(Panel1, ID_STATICTEXT2, _("Application Folder"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
wxFont StaticText2Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
StaticText2->SetFont(StaticText2Font);
BoxSizer6->Add(StaticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer5->Add(BoxSizer6, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer7->Add(35,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText1 = new wxStaticText(Panel1, ID_STATICTEXT1, _(" Please specify folder information about your application."), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
BoxSizer7->Add(StaticText1, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer5->Add(BoxSizer7, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer4->Add(BoxSizer5, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer4->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBitmap1 = new wxStaticBitmap(Panel1, wxID_ANY, wxBitmap(LinksOben_xpm), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
BoxSizer4->Add(StaticBitmap1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
Panel1->SetSizer(BoxSizer4);
BoxSizer4->Fit(Panel1);
BoxSizer4->SetSizeHints(Panel1);
BoxSizer1->Add(Panel1, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticLine1 = new wxStaticLine(this, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
BoxSizer1->Add(StaticLine1, 0, wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2 = new wxBoxSizer(wxVERTICAL);
BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer3->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
text1 = new wxStaticText(this, ID_STATICTEXT3, _("Application destination base folder:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
wxFont text1Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
text1->SetFont(text1Font);
BoxSizer3->Add(text1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer3->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer3, 0, wxBOTTOM|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer8->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
chProgrammFolder = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxSize(214,21), 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
chProgrammFolder->SetSelection( chProgrammFolder->Append(_("program Files folder")) );
chProgrammFolder->Append(_("(custom)"));
BoxSizer8->Add(chProgrammFolder, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer8->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer8, 0, wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer9->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
txtCustom = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxSize(217,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
txtCustom->Disable();
BoxSizer9->Add(txtCustom, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer9->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer9, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer10->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
text2 = new wxStaticText(this, ID_STATICTEXT4, _("Application folder name:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
wxFont text2Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
text2->SetFont(text2Font);
BoxSizer10->Add(text2, 1, wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer10->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer10, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer11->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
txtAppFolderName = new wxTextCtrl(this, ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(221,21), 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
BoxSizer11->Add(txtAppFolderName, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer11->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer11, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer12->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
cbAppFolderName = new wxCheckBox(this, ID_CHECKBOX1, _("Allow user to change the application folder"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
cbAppFolderName->SetValue(true);
BoxSizer12->Add(cbAppFolderName, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer12->Add(-1,-1,1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(BoxSizer12, 0, wxTOP|wxLEFT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer13->Add(75,20,0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
//.........这里部分代码省略.........
示例4: wxDialog
//.........这里部分代码省略.........
mCategories = new wxTreebookExt(this, wxID_ANY, mTitlePrefix);
S.StartHorizontalLay(wxALIGN_LEFT | wxEXPAND, true);
{
S.Prop(1);
S.AddWindow(mCategories, wxEXPAND);
{
typedef std::pair<int, int> IntPair;
std::vector<IntPair> stack;
int iPage = 0;
for (Factories::const_iterator it = factories.begin(), end = factories.end();
it != end; ++it, ++iPage)
{
const PrefsNode &node = *it;
PrefsPanelFactory &factory = *node.pFactory;
wxWindow *const w = factory.Create(mCategories);
if (stack.empty())
// Parameters are: AddPage(page, name, IsSelected, imageId).
mCategories->AddPage(w, w->GetName(), false, 0);
else {
IntPair &top = *stack.rbegin();
mCategories->InsertSubPage(top.first, w, w->GetName(), false, 0);
if (--top.second == 0) {
// Expand all nodes before the layout calculation
mCategories->ExpandNode(top.first, true);
stack.pop_back();
}
}
if (node.nChildren > 0)
stack.push_back(IntPair(iPage, node.nChildren));
}
}
}
S.EndHorizontalLay();
}
else {
// Unique page, don't show the factory
const PrefsNode &node = factories[0];
PrefsPanelFactory &factory = *node.pFactory;
mUniquePage = factory.Create(this);
S.AddWindow(mUniquePage, wxEXPAND);
}
}
S.EndVerticalLay();
S.AddStandardButtons(eOkButton | eCancelButton | eApplyButton);
static_cast<wxButton*>(wxWindow::FindWindowById(wxID_OK, this))->SetDefault();
if (mUniquePage && !mUniquePage->ShowsApplyButton()) {
wxWindow *const applyButton =
wxWindow::FindWindowById(wxID_APPLY, GetParent());
applyButton->Show(false);
}
#if defined(__WXGTK__)
if (mCategories)
mCategories->GetTreeCtrl()->EnsureVisible(mCategories->GetTreeCtrl()->GetRootItem());
#endif
// mCategories->SetSizeHints(-1, -1, 790, 600); // 790 = 800 - (border * 2)
Layout();
Fit();
wxSize sz = GetSize();
// Collapse nodes only after layout so the tree is wide enough
if (mCategories)
{
int iPage = 0;
for (Factories::const_iterator it = factories.begin(), end = factories.end();
it != end; ++it, ++iPage)
mCategories->ExpandNode(iPage, it->expanded);
}
// This ASSERT used to limit us to 800 x 600.
// However, we think screens have got bigger now, and that was a bit too restrictive.
// The impetus for increasing the limit (before we ASSERT) was that this ASSERT
// was firing with wxWidgets 3.0, which has slightly different sizer behaviour.
wxASSERT_MSG(sz.x <= 1000 && sz.y <= 750, wxT("Preferences dialog exceeds max size"));
if (sz.x > 800) {
sz.x = 800;
}
if (sz.y > 600) {
sz.y = 600;
}
// Set the minimum height to be slightly bigger than default, as fix for bug 161.
// The magic number 7 was determined by Ed's experimentation.
// Frankly, this is a hack to work around a bug in wxTreebook, and
// will have to be revisited if we add another category to mCategories.
// JKC later added a category and 20 onto the 7.
sz.y += 7 + 20;
SetSize(sz);
SetMinSize(sz);
// Center after all that resizing, but make sure it doesn't end up
// off-screen
CentreOnParent();
}
示例5: URHO3D_LOGERROR
bool Texture2D::SetData(Image* image, bool useAlpha)
{
if (!image)
{
URHO3D_LOGERROR("Null image, can not load texture");
return false;
}
// Use a shared ptr for managing the temporary mip images created during this function
SharedPtr<Image> mipImage;
unsigned memoryUse = sizeof(Texture2D);
int quality = QUALITY_HIGH;
Renderer* renderer = GetSubsystem<Renderer>();
if (renderer)
quality = renderer->GetTextureQuality();
if (!image->IsCompressed())
{
unsigned char* levelData = image->GetData();
int levelWidth = image->GetWidth();
int levelHeight = image->GetHeight();
unsigned components = image->GetComponents();
unsigned format = 0;
// Discard unnecessary mip levels
for (unsigned i = 0; i < mipsToSkip_[quality]; ++i)
{
mipImage = image->GetNextLevel(); image = mipImage;
levelData = image->GetData();
levelWidth = image->GetWidth();
levelHeight = image->GetHeight();
}
switch (components)
{
case 1:
format = useAlpha ? Graphics::GetAlphaFormat() : Graphics::GetLuminanceFormat();
break;
case 2:
format = Graphics::GetLuminanceAlphaFormat();
break;
case 3:
format = Graphics::GetRGBFormat();
break;
case 4:
format = Graphics::GetRGBAFormat();
break;
default:
assert(false); // Should never reach here
break;
}
// If image was previously compressed, reset number of requested levels to avoid error if level count is too high for new size
if (IsCompressed() && requestedLevels_ > 1)
requestedLevels_ = 0;
SetSize(levelWidth, levelHeight, format);
for (unsigned i = 0; i < levels_; ++i)
{
SetData(i, 0, 0, levelWidth, levelHeight, levelData);
memoryUse += levelWidth * levelHeight * components;
if (i < levels_ - 1)
{
mipImage = image->GetNextLevel(); image = mipImage;
levelData = image->GetData();
levelWidth = image->GetWidth();
levelHeight = image->GetHeight();
}
}
}
else
{
int width = image->GetWidth();
int height = image->GetHeight();
unsigned levels = image->GetNumCompressedLevels();
unsigned format = graphics_->GetFormat(image->GetCompressedFormat());
bool needDecompress = false;
if (!format)
{
format = Graphics::GetRGBAFormat();
needDecompress = true;
}
unsigned mipsToSkip = mipsToSkip_[quality];
if (mipsToSkip >= levels)
mipsToSkip = levels - 1;
while (mipsToSkip && (width / (1 << mipsToSkip) < 4 || height / (1 << mipsToSkip) < 4))
--mipsToSkip;
width /= (1 << mipsToSkip);
height /= (1 << mipsToSkip);
SetNumLevels(Max((levels - mipsToSkip), 1U));
SetSize(width, height, format);
//.........这里部分代码省略.........
示例6: wxDynamicCast
//.........这里部分代码省略.........
wxFrame* frame = wxDynamicCast(this, wxFrame);
if (frame && frame->GetToolBar())
{
frame->GetToolBar()->Show(true);
}
}
#endif
m_fsIsShowing = show;
wxX11FullScreenMethod method =
wxGetFullScreenMethodX11((WXDisplay*)GDK_DISPLAY(),
(WXWindow)GDK_ROOT_WINDOW());
#if GTK_CHECK_VERSION(2,2,0)
// NB: gtk_window_fullscreen() uses freedesktop.org's WMspec extensions
// to switch to fullscreen, which is not always available. We must
// check if WM supports the spec and use legacy methods if it
// doesn't.
if ( (method == wxX11_FS_WMSPEC) && !gtk_check_version(2,2,0) )
{
if (show)
{
m_fsSaveFlag = style;
gtk_window_fullscreen( GTK_WINDOW( m_widget ) );
}
else
{
m_fsSaveFlag = 0;
gtk_window_unfullscreen( GTK_WINDOW( m_widget ) );
}
}
else
#endif // GTK+ >= 2.2.0
{
GdkWindow *window = m_widget->window;
if (show)
{
m_fsSaveFlag = style;
GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );
int screen_width,screen_height;
wxDisplaySize( &screen_width, &screen_height );
gint client_x, client_y, root_x, root_y;
gint width, height;
if (method != wxX11_FS_WMSPEC)
{
// don't do it always, Metacity hates it
m_fsSaveGdkFunc = m_gdkFunc;
m_fsSaveGdkDecor = m_gdkDecor;
m_gdkFunc = m_gdkDecor = 0;
gdk_window_set_decorations(window, (GdkWMDecoration)0);
gdk_window_set_functions(window, (GdkWMFunction)0);
}
gdk_window_get_origin (m_widget->window, &root_x, &root_y);
gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
&width, &height, NULL);
gdk_window_move_resize (m_widget->window, -client_x, -client_y,
screen_width + 1, screen_height + 1);
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
(WXWindow)GDK_ROOT_WINDOW(),
(WXWindow)GDK_WINDOW_XWINDOW(window),
show, &m_fsSaveFrame, method);
}
else // hide
{
m_fsSaveFlag = 0;
if (method != wxX11_FS_WMSPEC)
{
// don't do it always, Metacity hates it
m_gdkFunc = m_fsSaveGdkFunc;
m_gdkDecor = m_fsSaveGdkDecor;
gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);
}
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
(WXWindow)GDK_ROOT_WINDOW(),
(WXWindow)GDK_WINDOW_XWINDOW(window),
show, &m_fsSaveFrame, method);
SetSize(m_fsSaveFrame.x, m_fsSaveFrame.y,
m_fsSaveFrame.width, m_fsSaveFrame.height);
}
}
// documented behaviour is to show the window if it's still hidden when
// showing it full screen
if ( show && !IsShown() )
Show();
return true;
}
示例7: m_cards
DialogCard::DialogCard(wxWindow* parent, unsigned controls, const CardDeck& cards, const FlashCardOptions& options) :
m_cards(cards),
m_cardIndex(0),
m_panelConceal(NULL),
m_panelAnswer(NULL),
m_htmlQuestion(NULL),
m_htmlAnswer(NULL),
m_buttonYes(NULL),
m_buttonPartially(NULL),
m_buttonNo(NULL),
m_buttonNext(NULL),
m_buttonPrevious(NULL),
m_checkboxLearned(NULL),
m_checkboxEnabled(NULL),
m_staticRemember(NULL)
{
wxXmlResource::Get()->LoadDialog(this, parent, wxT("DialogCard"));
m_panelConceal = XRCCTRL(*this, "panelConceal", wxPanel);
m_panelAnswer = XRCCTRL(*this, "panelAnswer", wxPanel);
m_htmlQuestion = XRCCTRL(*this, "htmlQuestion", wxHtmlWindow);
m_htmlAnswer = XRCCTRL(*this, "htmlAnswer", wxHtmlWindow);
m_buttonYes = XRCCTRL(*this, "buttonYes", wxButton);
m_buttonPartially = XRCCTRL(*this, "buttonPartially", wxButton);
m_buttonNo = XRCCTRL(*this, "buttonNo", wxButton);
m_buttonNext = XRCCTRL(*this, "buttonNext", wxButton);
m_buttonPrevious = XRCCTRL(*this, "buttonPrevious", wxButton);
m_checkboxLearned = XRCCTRL(*this, "checkboxLearned", wxCheckBox);
m_checkboxEnabled = XRCCTRL(*this, "checkboxEnabled", wxCheckBox);
m_staticRemember = XRCCTRL(*this, "staticRemember", wxStaticText);
m_htmlQuestion->SetFonts(options.fontNameNormal, options.fontNameFixed, options.fontSizes);
m_htmlQuestion->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(DialogCard::OnHtmlQuestionDblClick), NULL, this);
m_htmlAnswer->SetFonts(options.fontNameNormal, options.fontNameFixed, options.fontSizes);
m_htmlAnswer->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(DialogCard::OnHtmlAnswerDblClick), NULL, this);
if (IS_TRUE(controls & BIT(CARD_CTRL_LEARNED)))
{
m_checkboxLearned->Show();
}
if (IS_TRUE(controls & BIT(CARD_CTRL_ENABLED)))
{
m_checkboxEnabled->Show();
}
if (IS_TRUE(controls & BIT(CARD_CTRL_NAVIGATE)))
{
m_buttonPrevious->Show();
m_buttonNext->Show();
}
if (IS_TRUE(controls & BIT(CARD_CTRL_QUIZ)))
{
m_staticRemember->Show();
m_buttonYes->Show();
m_buttonPartially->Show();
m_buttonNo->Show();
HideAnswer();
}
UpdateCard();
SetSize(640, 480);
}
示例8: WXUNUSED
MyDialog::MyDialog( wxWindow *parent, const wxString& title,
const wxPoint& pos, const wxSize& size, const long WXUNUSED(style) ) :
wxDialog(parent, VALIDATE_DIALOG_ID, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
// setup the flex grid sizer
// -------------------------
wxFlexGridSizer *flexgridsizer = new wxFlexGridSizer(3, 2, 5, 5);
// Create and add controls to sizers. Note that a member variable
// of g_data is bound to each control upon construction. There is
// currently no easy way to substitute a different validator or a
// different transfer variable after a control has been constructed.
// Pointers to some of these controls are saved in member variables
// so that we can use them elsewhere, like this one.
m_text = new wxTextCtrl(this, VALIDATE_TEXT, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0,
wxTextValidator(wxFILTER_ALPHA, &g_data.m_string));
m_text->SetToolTip("uses wxTextValidator with wxFILTER_ALPHA");
flexgridsizer->Add(m_text, 1, wxGROW);
// Now set a wxTextValidator with an explicit list of characters NOT allowed:
wxTextValidator textVal(wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST, &g_data.m_string2);
textVal.SetCharExcludes("bcwyz");
wxTextCtrl* txt2 =
new wxTextCtrl(this, VALIDATE_TEXT2, wxEmptyString,
wxDefaultPosition, wxDefaultSize, 0, textVal);
txt2->SetToolTip("uses wxTextValidator with wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST (to exclude 'bcwyz')");
flexgridsizer->Add(txt2, 1, wxGROW);
flexgridsizer->Add(new wxListBox((wxWindow*)this, VALIDATE_LIST,
wxDefaultPosition, wxDefaultSize,
3, g_listbox_choices, wxLB_MULTIPLE,
wxGenericValidator(&g_data.m_listbox_choices)),
1, wxGROW);
m_combobox = new wxComboBox(this, VALIDATE_COMBO, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
3, g_combobox_choices, 0L,
MyComboBoxValidator(&g_data.m_combobox_choice));
m_combobox->SetToolTip("uses a custom validator (MyComboBoxValidator)");
flexgridsizer->Add(m_combobox, 1, wxALIGN_CENTER);
// This wxCheckBox* doesn't need to be assigned to any pointer
// because we don't use it elsewhere--it can be anonymous.
// We don't need any such pointer to query its state, which
// can be gotten directly from g_data.
flexgridsizer->Add(new wxCheckBox(this, VALIDATE_CHECK, wxT("Sample checkbox"),
wxDefaultPosition, wxDefaultSize, 0,
wxGenericValidator(&g_data.m_checkbox_state)),
1, wxALIGN_CENTER|wxALL, 15);
flexgridsizer->AddGrowableCol(0);
flexgridsizer->AddGrowableCol(1);
flexgridsizer->AddGrowableRow(1);
// setup the button sizer
// ----------------------
wxStdDialogButtonSizer *btn = new wxStdDialogButtonSizer();
btn->AddButton(new wxButton(this, wxID_OK));
btn->AddButton(new wxButton(this, wxID_CANCEL));
btn->Realize();
// setup the main sizer
// --------------------
wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
mainsizer->Add(flexgridsizer, 1, wxGROW | wxALL, 10);
mainsizer->Add(new wxRadioBox((wxWindow*)this, VALIDATE_RADIO, wxT("Pick a color"),
wxDefaultPosition, wxDefaultSize,
3, g_radiobox_choices, 1, wxRA_SPECIFY_ROWS,
wxGenericValidator(&g_data.m_radiobox_choice)),
0, wxGROW | wxLEFT|wxBOTTOM|wxRIGHT, 10);
mainsizer->Add(btn, 0, wxGROW | wxALL, 10);
SetSizer(mainsizer);
mainsizer->SetSizeHints(this);
// make the dialog a bit bigger than its minimal size:
SetSize(GetBestSize()*1.5);
}
示例9: SetSize
bool VertexBuffer::SetSize(unsigned vertexCount, unsigned elementMask, bool dynamic)
{
return SetSize(vertexCount, GetElements(elementMask), dynamic);
}
示例10: CaptionVisible
void wxAuiFloatingFrame::SetPaneWindow(const wxAuiPaneInfo& pane)
{
m_pane_window = pane.window;
m_pane_window->Reparent(this);
wxAuiPaneInfo contained_pane = pane;
contained_pane.Dock().Center().Show().
CaptionVisible(false).
PaneBorder(false).
Layer(0).Row(0).Position(0);
// Carry over the minimum size
wxSize pane_min_size = pane.window->GetMinSize();
// if the frame window's max size is greater than the min size
// then set the max size to the min size as well
wxSize cur_max_size = GetMaxSize();
if (cur_max_size.IsFullySpecified() &&
(cur_max_size.x < pane.min_size.x ||
cur_max_size.y < pane.min_size.y)
)
{
SetMaxSize(pane_min_size);
}
SetMinSize(pane.window->GetMinSize());
m_mgr.AddPane(m_pane_window, contained_pane);
m_mgr.Update();
if (pane.min_size.IsFullySpecified())
{
// because SetSizeHints() calls Fit() too (which sets the window
// size to its minimum allowed), we keep the size before calling
// SetSizeHints() and reset it afterwards...
wxSize tmp = GetSize();
GetSizer()->SetSizeHints(this);
SetSize(tmp);
}
SetTitle(pane.caption);
// This code is slightly awkward because we need to reset wxRESIZE_BORDER
// before calling SetClientSize() below as doing it after setting the
// client size would actually change it, at least under MSW, where the
// total window size doesn't change and hence, as the borders size changes,
// the client size does change.
//
// So we must call it first but doing it generates a size event and updates
// pane.floating_size from inside it so we must also record its original
// value before doing it.
const bool hasFloatingSize = pane.floating_size != wxDefaultSize;
if (pane.IsFixed())
{
SetWindowStyleFlag(GetWindowStyleFlag() & ~wxRESIZE_BORDER);
}
if ( hasFloatingSize )
{
SetSize(pane.floating_size);
}
else
{
wxSize size = pane.best_size;
if (size == wxDefaultSize)
size = pane.min_size;
if (size == wxDefaultSize)
size = m_pane_window->GetSize();
if (m_owner_mgr && pane.HasGripper())
{
if (pane.HasGripperTop())
size.y += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
else
size.x += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
}
SetClientSize(size);
}
}
示例11: game
TiledSpriteObjectEditor::TiledSpriteObjectEditor( wxWindow* parent, gd::Project & game_, TiledSpriteObject & object_, gd::MainFrameWrapper & mainFrameWrapper_ ) :
game(game_),
mainFrameWrapper(mainFrameWrapper_),
object(object_)
{
//(*Initialize(TiledSpriteObjectEditor)
wxStaticBoxSizer* StaticBoxSizer2;
wxFlexGridSizer* FlexGridSizer4;
wxFlexGridSizer* FlexGridSizer3;
wxFlexGridSizer* FlexGridSizer5;
wxFlexGridSizer* FlexGridSizer2;
wxFlexGridSizer* FlexGridSizer7;
wxFlexGridSizer* FlexGridSizer6;
wxStaticBoxSizer* StaticBoxSizer1;
wxFlexGridSizer* FlexGridSizer1;
Create(parent, wxID_ANY, _("Settings of the Tiled Sprite Object"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER, _T("wxID_ANY"));
FlexGridSizer1 = new wxFlexGridSizer(0, 1, 0, 0);
FlexGridSizer1->AddGrowableCol(0);
FlexGridSizer1->AddGrowableRow(0);
Core = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
FlexGridSizer2 = new wxFlexGridSizer(0, 1, 0, 0);
FlexGridSizer2->AddGrowableCol(0);
FlexGridSizer2->AddGrowableRow(0);
FlexGridSizer4 = new wxFlexGridSizer(0, 1, 0, 0);
FlexGridSizer4->AddGrowableCol(0);
FlexGridSizer4->AddGrowableRow(0);
FlexGridSizer5 = new wxFlexGridSizer(0, 3, 0, 0);
FlexGridSizer5->AddGrowableCol(0);
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, Core, _("Size"));
FlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0);
FlexGridSizer6->AddGrowableCol(1);
StaticText7 = new wxStaticText(Core, ID_STATICTEXT7, _("Width :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT7"));
FlexGridSizer6->Add(StaticText7, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
widthEdit = new wxTextCtrl(Core, ID_TEXTCTRL7, _("32"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL7"));
FlexGridSizer6->Add(widthEdit, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText8 = new wxStaticText(Core, ID_STATICTEXT8, _("Height :"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT8"));
FlexGridSizer6->Add(StaticText8, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
heightEdit = new wxTextCtrl(Core, ID_TEXTCTRL8, _("32"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL8"));
FlexGridSizer6->Add(heightEdit, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer2->Add(FlexGridSizer6, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer5->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer4->Add(FlexGridSizer5, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, Core, _("Textures"));
FlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0);
FlexGridSizer3->AddGrowableCol(0);
frontTextureEdit = new wxTextCtrl(Core, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
FlexGridSizer3->Add(frontTextureEdit, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
frontAddFromBt = new wxBitmapButton(Core, ID_BITMAPBUTTON1, wxBitmap(wxImage(_T("res/addfromimagebanque.png"))), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON1"));
FlexGridSizer3->Add(frontAddFromBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
smoothCheckBox = new wxCheckBox(Core, ID_CHECKBOX1, _("Smooth texture"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
smoothCheckBox->SetValue(false);
FlexGridSizer3->Add(smoothCheckBox, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer1->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer4->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer2->Add(FlexGridSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticLine1 = new wxStaticLine(Core, ID_STATICLINE1, wxDefaultPosition, wxSize(10,-1), wxLI_HORIZONTAL, _T("ID_STATICLINE1"));
FlexGridSizer2->Add(StaticLine1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer7 = new wxFlexGridSizer(0, 3, 0, 0);
imageBankBt = new wxButton(Core, ID_BUTTON3, _("Show image bank\'s editor"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
FlexGridSizer7->Add(imageBankBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
okBt = new wxButton(Core, ID_BUTTON1, _("Ok"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
FlexGridSizer7->Add(okBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
cancelBt = new wxButton(Core, ID_BUTTON2, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
FlexGridSizer7->Add(cancelBt, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer2->Add(FlexGridSizer7, 1, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
Core->SetSizer(FlexGridSizer2);
FlexGridSizer2->Fit(Core);
FlexGridSizer2->SetSizeHints(Core);
FlexGridSizer1->Add(Core, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
SetSizer(FlexGridSizer1);
FlexGridSizer1->Fit(this);
FlexGridSizer1->SetSizeHints(this);
Connect(ID_BITMAPBUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TiledSpriteObjectEditor::OnfrontAddFromBtClick);
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TiledSpriteObjectEditor::OnimageBankBtClick);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TiledSpriteObjectEditor::OnokBtClick);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&TiledSpriteObjectEditor::OncancelBtClick);
//*)
frontTextureEdit->ChangeValue(object.textureName);
widthEdit->ChangeValue(gd::String::From(object.GetWidth()));
heightEdit->ChangeValue(gd::String::From(object.GetHeight()));
//Init the image bank editor
resourcesEditor = new ResourcesEditor( this, game, mainFrameWrapper );
resourcesEditor->Refresh();
//Init wxAuiManager with two pane : the editor and the image bank editor
m_mgr.SetManagedWindow( this );
gd::SkinHelper::ApplyCurrentSkin(m_mgr);
m_mgr.AddPane( Core, wxAuiPaneInfo().Name( wxT( "Core" ) ).Center().CaptionVisible(false) );
m_mgr.AddPane( resourcesEditor, wxAuiPaneInfo().Name( wxT( "EI" ) ).Left().Caption( _("Images Bank Editor") ).MaximizeButton( true ).MinimizeButton( false ).Show(true).MinSize(210, 100) );
m_mgr.SetFlags( wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_ALLOW_ACTIVE_PANE | wxAUI_MGR_TRANSPARENT_HINT
| wxAUI_MGR_TRANSPARENT_DRAG | wxAUI_MGR_HINT_FADE | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE );
m_mgr.Update();
SetSize(800,640);
resourcesEditor->toolbar->Realize(); //Mandatory on linux to display the toolbar.
//.........这里部分代码省略.........
示例12: SetSize
// ---------------------------------------------------------
// CMsgBodyControlEditor::SetAndGetSizeL
//
// Calculates and sets the size of the control and returns new size as
// reference aSize.
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::SetAndGetSizeL( TSize& aSize )
{
// This may change the heigh if the content has changed
SetSize( aSize );
aSize = iSize;
}
示例13: SetSize
void GuiList::Clear()
{
GuiComposite::Clear();
m_selset.clear();
SetSize(Vec2f(0, 0)); // this is so we can't scroll past the bottom
}
示例14: wxDialog
ProjectSettings::ProjectSettings(wxWindow* parent, const cxProjectInfo& project, const cxProjectInfo& parentProject):
wxDialog (parent, wxID_ANY, _("Project Settings"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER),
m_projectInfo(project),
m_parentProject(parentProject),
m_envModified(false)
{
// Create the notebook
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
wxNotebook* notebook = new wxNotebook(this, wxID_ANY);
{
// Create the filter page
wxPanel* filterPage = new wxPanel(notebook, wxID_ANY);
{
m_inheritCheck = new wxCheckBox(filterPage, ID_INHERIT, _("Inherit from parent"));
m_includeDirs = new wxTextCtrl(filterPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
m_includeFiles = new wxTextCtrl(filterPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
m_excludeDirs = new wxTextCtrl(filterPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
m_excludeFiles = new wxTextCtrl(filterPage, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
// Layout
wxBoxSizer* pageSizer = new wxBoxSizer(wxVERTICAL);
pageSizer->Add(m_inheritCheck, 0, wxALL, 5);
if (project.IsRoot()) pageSizer->Hide(m_inheritCheck);
wxFlexGridSizer* filterSizer = new wxFlexGridSizer(4, 2, 0, 0);
filterSizer->AddGrowableCol(0);
filterSizer->AddGrowableCol(1);
filterSizer->AddGrowableRow(1);
filterSizer->AddGrowableRow(3);
filterSizer->Add(new wxStaticText(filterPage, wxID_ANY, _("Include Dirs:")), 0, wxALL, 5);
filterSizer->Add(new wxStaticText(filterPage, wxID_ANY, _("Include Files:")), 0, wxALL, 5);
filterSizer->Add(m_includeDirs, 1, wxEXPAND|wxALL, 5);
filterSizer->Add(m_includeFiles, 1, wxEXPAND|wxALL, 5);
filterSizer->Add(new wxStaticText(filterPage, wxID_ANY, _("Exclude Dirs:")), 0, wxALL, 5);
filterSizer->Add(new wxStaticText(filterPage, wxID_ANY, _("Exclude Files:")), 0, wxALL, 5);
filterSizer->Add(m_excludeDirs, 1, wxEXPAND|wxALL, 5);
filterSizer->Add(m_excludeFiles, 1, wxEXPAND|wxALL, 5);
pageSizer->Add(filterSizer, 1, wxEXPAND|wxALL, 5);
filterPage->SetSizer(pageSizer);
notebook->AddPage(filterPage, _("Filters"), true);
}
if (project.IsRoot()) {
m_envPage = new EnvVarsPanel(notebook);
notebook->AddPage(m_envPage, _("Environment"), true);
}
mainSizer->Add(notebook, 1, wxEXPAND|wxALL, 5);
}
// Buttons
mainSizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxALL, 5);
// Load filters
const cxProjectInfo *projectToLoad = NULL;
if (project.HasFilters() || project.IsRoot()) {
projectToLoad = &project;
}
else {
projectToLoad = &parentProject;
m_includeDirs->Disable();
m_excludeDirs->Disable();
m_includeFiles->Disable();
m_excludeFiles->Disable();
m_inheritCheck->SetValue(true);
}
if (projectToLoad) {
const wxString ind = wxJoin(projectToLoad->includeDirs, wxT('\n'), wxT('\0'));
m_includeDirs->SetValue(ind);
const wxString inf = wxJoin(projectToLoad->includeFiles, wxT('\n'), wxT('\0'));
m_includeFiles->SetValue(inf);
const wxString exd = wxJoin(projectToLoad->excludeDirs, wxT('\n'), wxT('\0'));
m_excludeDirs->SetValue(exd);
const wxString exf = wxJoin(projectToLoad->excludeFiles, wxT('\n'), wxT('\0'));
m_excludeFiles->SetValue(exf);
}
// Load env variables
if (project.IsRoot()) {
m_envPage->AddVars(project.env);
}
notebook->ChangeSelection(0);
SetSizerAndFit(mainSizer);
SetSize(350, 300);
CentreOnParent();
}
示例15: SetSize
Box::Box(float width, float height)
{
SetSize(width, height);
}