本文整理汇总了C++中SetInitialSize函数的典型用法代码示例。如果您正苦于以下问题:C++ SetInitialSize函数的具体用法?C++ SetInitialSize怎么用?C++ SetInitialSize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetInitialSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setProgress
/* SplashWindow::show
* Shows the splash window with [message]. If [progress] is true, a
* progress bar will also be shown
*******************************************************************/
void SplashWindow::show(string message, bool progress, wxWindow* parent)
{
// Setup progress bar
int rheight = height;
if (progress)
{
show_progress = true;
setProgress(0.0f);
rheight += 10;
}
else
show_progress = false;
// Set parent
if (!parent && theApp->isInitialised())
SetParent(theMainWindow);
else
SetParent(parent);
// Show & init window
#ifndef __WXGTK__
SetInitialSize(wxSize(width, rheight));
#else
SetInitialSize(wxSize(width + 6, rheight + 6));
#endif
setMessage(message);
Show();
CentreOnParent();
forceRedraw();
}
示例2: switch
void CtrlRegisterList::onPopupClick(wxCommandEvent& evt)
{
switch (evt.GetId())
{
case ID_REGISTERLIST_DISPLAY32:
resolvePointerStrings = false;
maxBits = 32;
SetInitialSize(ClientToWindowSize(GetMinClientSize()));
postEvent(debEVT_UPDATELAYOUT,0);
Refresh();
break;
case ID_REGISTERLIST_DISPLAY64:
resolvePointerStrings = false;
maxBits = 64;
SetInitialSize(ClientToWindowSize(GetMinClientSize()));
postEvent(debEVT_UPDATELAYOUT,0);
Refresh();
break;
case ID_REGISTERLIST_DISPLAY128:
resolvePointerStrings = false;
maxBits = 128;
SetInitialSize(ClientToWindowSize(GetMinClientSize()));
postEvent(debEVT_UPDATELAYOUT,0);
Refresh();
break;
case ID_REGISTERLIST_DISPLAY128STRINGS:
resolvePointerStrings = true;
maxBits = 128;
SetInitialSize(ClientToWindowSize(GetMinClientSize()));
postEvent(debEVT_UPDATELAYOUT, 0);
Refresh();
break;
case ID_REGISTERLIST_CHANGELOWER:
changeValue(LOWER64);
Refresh();
break;
case ID_REGISTERLIST_CHANGEUPPER:
changeValue(UPPER64);
Refresh();
break;
case ID_REGISTERLIST_CHANGEVALUE:
if (cpu->getRegisterSize(category) == 32)
changeValue(CHANGE32);
else
changeValue(LOWER64);
Refresh();
break;
case ID_REGISTERLIST_GOTOINMEMORYVIEW:
postEvent(debEVT_GOTOINMEMORYVIEW, cpu->getRegister(category, currentRows[category])._u32[0]);
break;
case ID_REGISTERLIST_GOTOINDISASM:
postEvent(debEVT_GOTOINDISASM, cpu->getRegister(category, currentRows[category])._u32[0]);
break;
default:
wxMessageBox( L"Unimplemented.", L"Unimplemented.", wxICON_INFORMATION);
break;
}
}
示例3: SetInitialSize
bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
const wxURI& location,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& szBackend,
const wxValidator& validator,
const wxString& name)
{
if(!szBackend.empty())
{
wxClassInfo* pClassInfo = wxClassInfo::FindClass(szBackend);
if(!pClassInfo || !DoCreate(pClassInfo, parent, id,
pos, size, style, validator, name))
{
m_imp = NULL;
return false;
}
if (!Load(location))
{
delete m_imp;
m_imp = NULL;
return false;
}
SetInitialSize(size);
return true;
}
else
{
wxClassInfo::const_iterator it = wxClassInfo::begin_classinfo();
const wxClassInfo* classInfo;
while((classInfo = NextBackend(&it)) != NULL)
{
if(!DoCreate(classInfo, parent, id,
pos, size, style, validator, name))
continue;
if (Load(location))
{
SetInitialSize(size);
return true;
}
else
delete m_imp;
}
m_imp = NULL;
return false;
}
}
示例4: SetInitialSize
/* SDialog::setSavedSize
* Resizes the dialog to its saved size
*******************************************************************/
void SDialog::setSavedSize(int def_width, int def_height)
{
Misc::winf_t info = Misc::getWindowInfo(id);
if (!info.id.IsEmpty())
{
SetInitialSize(wxSize(info.width, info.height));
SetClientSize(info.width, info.height);
}
else
{
SetInitialSize(wxSize(def_width, def_height));
SetClientSize(def_width, def_height);
}
}
示例5: SetBackgroundColour
bool wxChoice::CreateAndInit(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
int n, const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)
{
// initialize wxControl
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
// now create the real HWND
if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) )
return false;
// choice/combobox normally has "white" (depends on colour scheme, of
// course) background rather than inheriting the parent's background
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
// initialize the controls contents
for ( int i = 0; i < n; i++ )
{
Append(choices[i]);
}
// and now we may finally size the control properly (if needed)
SetInitialSize(size);
return true;
}
示例6: OGLCanvas
/* ThingDirCanvas::ThingDirCanvas
* ThingDirCanvas class constructor
*******************************************************************/
ThingDirCanvas::ThingDirCanvas(wxWindow* parent) : OGLCanvas(parent, -1, true, 15)
{
// Init variables
angle = 0;
point_hl = -1;
last_check = 0;
point_sel = -1;
// Get system panel background colour
wxColour bgcolwx = Drawing::getPanelBGColour();
col_bg.set(bgcolwx.Red(), bgcolwx.Green(), bgcolwx.Blue());
// Get system text colour
wxColour textcol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
col_fg.set(textcol.Red(), textcol.Green(), textcol.Blue());
// Setup dir points
double rot = 0;
for (int a = 0; a < 8; a++)
{
dir_points.push_back(fpoint2_t(sin(rot), 0 - cos(rot)));
rot -= (3.1415926535897932384626433832795 * 2) / 8.0;
}
// Bind Events
Bind(wxEVT_MOTION, &ThingDirCanvas::onMouseEvent, this);
Bind(wxEVT_LEAVE_WINDOW, &ThingDirCanvas::onMouseEvent, this);
Bind(wxEVT_LEFT_DOWN, &ThingDirCanvas::onMouseEvent, this);
// Fixed size
SetInitialSize(wxSize(128, 128));
SetMaxSize(wxSize(128, 128));
}
示例7: wxFAIL_MSG
bool wxColourButton::Create( wxWindow *parent, wxWindowID id,
const wxColour &col,
const wxPoint &pos, const wxSize &size,
long style, const wxValidator& validator,
const wxString &name )
{
if (!PreCreation( parent, pos, size ) ||
!wxControl::CreateBase(parent, id, pos, size, style, validator, name))
{
wxFAIL_MSG( wxT("wxColourButton creation failed") );
return false;
}
m_colour = col;
#ifdef __WXGTK3__
m_widget = gtk_color_button_new_with_rgba(m_colour);
#else
m_widget = gtk_color_button_new_with_color( m_colour.GetColor() );
#endif
g_object_ref(m_widget);
// GtkColourButton signals
g_signal_connect(m_widget, "color-set",
G_CALLBACK(gtk_clrbutton_setcolor_callback), this);
m_parent->DoAddChild( this );
PostCreation(size);
SetInitialSize(size);
return true;
}
示例8: Append
bool wxListBox::Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
int n, const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)
{
// initialize base class fields
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
// create the native control
if ( !MSWCreateControl(wxT("LISTBOX"), wxEmptyString, pos, size) )
{
// control creation failed
return false;
}
// initialize the contents
for ( int i = 0; i < n; i++ )
{
Append(choices[i]);
}
// now we can compute our best size correctly, so do it again
SetInitialSize(size);
return true;
}
示例9: DoGetBestSize
bool wxCustomButton::Create(wxWindow* parent, wxWindowID id,
const wxString& label, const wxBitmap &bitmap,
const wxPoint& pos, const wxSize& size,
long style, const wxValidator& val,
const wxString& name)
{
if (!wxControl::Create(parent,id,pos,size,wxNO_BORDER|wxCLIP_CHILDREN,val,name))
return FALSE;
wxControl::SetLabel(label);
wxControl::SetBackgroundColour(parent->GetBackgroundColour());
wxControl::SetForegroundColour(parent->GetForegroundColour());
wxControl::SetFont(parent->GetFont());
if (bitmap.Ok()) m_bmpLabel = bitmap;
if (!SetButtonStyle(style)) return FALSE;
wxSize bestSize = DoGetBestSize();
SetSize(wxSize(size.x<0 ? bestSize.x:size.x, size.y<0 ? bestSize.y:size.y));
#if (wxMINOR_VERSION<8)
SetBestSize(GetSize());
#else
SetInitialSize(GetSize());
#endif
CalcLayout(TRUE);
return TRUE;
}
示例10: InitializeIIDs
CTimeCtrl::CTimeCtrl()
{
InitializeIIDs(&IID_DTime, &IID_DTimeEvents);
SetInitialSize(24, 22);
m_interval = (short) DEFAULT_INTERVAL; // initialize interval property
}
示例11: wxDialog
SetupWizardDialog::SetupWizardDialog(wxWindow* parent) : wxDialog(parent, -1, "First Time SLADE Setup", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
// Create pages
pages.push_back(new TempFolderWizardPage(this));
pages.push_back(new BaseResourceWizardPage(this));
pages.push_back(new NodeBuildersWizardPage(this));
current_page = 0;
// Hide all pages
for (unsigned a = 0; a < pages.size(); a++)
pages[a]->Show(false);
// Init layout
setupLayout();
// Set icon
wxIcon icon;
icon.CopyFromBitmap(getIcon("i_logo"));
SetIcon(icon);
// Setup layout
SetInitialSize(wxSize(600, 500));
Layout();
Fit();
SetMinSize(GetBestSize());
CenterOnParent();
showPage(0);
// Bind events
btn_next->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnNext, this);
btn_prev->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnPrev, this);
}
示例12: wxFAIL_MSG
bool wxAnimationCtrl::Create( wxWindow *parent, wxWindowID id,
const wxAnimation& anim,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if (!PreCreation( parent, pos, size ) ||
!base_type::CreateBase(parent, id, pos, size, style & wxWINDOW_STYLE_MASK,
wxDefaultValidator, name))
{
wxFAIL_MSG( wxT("wxAnimationCtrl creation failed") );
return false;
}
SetWindowStyle(style);
m_widget = gtk_image_new();
g_object_ref(m_widget);
gtk_widget_show(m_widget);
m_parent->DoAddChild( this );
PostCreation(size);
SetInitialSize(size);
if (anim.IsOk())
SetAnimation(anim);
// init the timer used for animation
m_timer.SetOwner(this);
return true;
}
示例13: wxScrolledWindow
CtrlRegisterList::CtrlRegisterList(wxWindow* parent, DebugInterface* _cpu)
: wxScrolledWindow(parent,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxWANTS_CHARS|wxBORDER_NONE|wxVSCROLL), cpu(_cpu)
{
rowHeight = getDebugFontHeight()+2;
charWidth = getDebugFontWidth();
category = 0;
maxBits = 128;
lastPc = 0xFFFFFFFF;
for (int i = 0; i < cpu->getRegisterCategoryCount(); i++)
{
int count = cpu->getRegisterCount(i);
ChangedReg* regs = new ChangedReg[count];
memset(regs,0,sizeof(ChangedReg)*count);
changedCategories.push_back(regs);
int maxLen = 0;
for (int k = 0; k < cpu->getRegisterCount(i); k++)
{
maxLen = std::max<int>(maxLen,strlen(cpu->getRegisterName(i,k)));
}
int x = 17+(maxLen+2)*charWidth;
startPositions.push_back(x);
currentRows.push_back(0);
}
SetDoubleBuffered(true);
SetInitialSize(ClientToWindowSize(GetMinClientSize()));
wxSize actualSize = getOptimalSize();
SetVirtualSize(actualSize);
SetScrollbars(1, rowHeight, actualSize.x, actualSize.y / rowHeight, 0, 0);
}
示例14: SetLabel
bool wxStaticText::Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) )
return false;
if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) )
return false;
// we set the label here and not through MSWCreateControl() because we
// need to do many operation on it for ellipsization&markup support
SetLabel(label);
// as we didn't pass the correct label to MSWCreateControl(), it didn't set
// the initial size correctly -- do it now
InvalidateBestSize();
SetInitialSize(size);
// NOTE: if the label contains ampersand characters which are interpreted as
// accelerators, they will be rendered (at least on WinXP) only if the
// static text is placed inside a window class which correctly handles
// focusing by TAB traversal (e.g. wxPanel).
return true;
}
示例15: Append
bool wxChoice::CreateAndInit(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
int n, const wxString choices[],
long style,
const wxValidator& validator,
const wxString& name)
{
// initialize wxControl
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
// now create the real HWND
if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) )
return false;
// initialize the controls contents
for ( int i = 0; i < n; i++ )
{
Append(choices[i]);
}
// and now we may finally size the control properly (if needed)
SetInitialSize(size);
return true;
}