本文整理汇总了C++中SetupWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ SetupWindow函数的具体用法?C++ SetupWindow怎么用?C++ SetupWindow使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetupWindow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XRC_MAKE_INSTANCE
wxObject *wxScrolledWindowXmlHandler::DoCreateResource()
{
XRC_MAKE_INSTANCE(control, wxScrolledWindow)
control->Create(m_parentAsWindow,
GetID(),
GetPosition(), GetSize(),
GetStyle(wxT("style"), wxHSCROLL | wxVSCROLL),
GetName());
SetupWindow(control);
CreateChildren(control);
if ( HasParam(wxT("scrollrate")) )
{
wxSize rate = GetSize(wxT("scrollrate"));
control->SetScrollRate(rate.x, rate.y);
}
return control;
}
示例2: wxSplitterWindow
wxObject* wxsSplitterWindow::OnBuildPreview(wxWindow* Parent,long Flags)
{
wxSplitterWindow* Splitter = new wxSplitterWindow(Parent,GetId(),Pos(Parent),Size(Parent),Style());
SetupWindow(Splitter,Flags);
if ( MinSize != -1 )
{
Splitter->SetMinimumPaneSize(MinSize);
}
AddChildrenPreview(Splitter,Flags);
if ( GetChildCount() == 0 )
{
}
else if ( GetChildCount() == 1 )
{
Splitter->Initialize(wxDynamicCast(GetChild(0)->GetLastPreview(),wxWindow));
}
else
{
if ( Orientation == wxHORIZONTAL )
{
Splitter->SplitHorizontally(
wxDynamicCast(GetChild(0)->GetLastPreview(),wxWindow),
wxDynamicCast(GetChild(1)->GetLastPreview(),wxWindow),
SashPos);
}
else
{
Splitter->SplitVertically(
wxDynamicCast(GetChild(0)->GetLastPreview(),wxWindow),
wxDynamicCast(GetChild(1)->GetLastPreview(),wxWindow),
SashPos);
}
Splitter->SetSashGravity(SashGravity);
// Some trick to faster relayout splitter window
Splitter->OnInternalIdle();
}
return Splitter;
}
示例3: glfwSetErrorCallback
bool GameWindow::AutoSetupWindow(Application* _parent)
{
Parent = _parent;
glfwSetErrorCallback(glfwError);
// todo: enum modes
if (!glfwInit())
{
Log::Logf("Failure to initialize glfw.\n");
return false; // std::exception("glfw failed initialization!"); // don't do shit
}
AssignSize();
matrixSize.x = ScreenWidth;
matrixSize.y = ScreenHeight;
IsFullscreen = Configuration::GetConfigf("Fullscreen") != 0;
doFlush = Configuration::GetConfigf("VideoFlush") != 0;
VSync = Configuration::GetConfigf("VSync") != 0;
if (!(wnd = glfwCreateWindow(size.x, size.y, RAINDROP_WINDOWTITLE RAINDROP_VERSIONTEXT, IsFullscreen ? glfwGetPrimaryMonitor() : NULL, NULL)))
{
Log::Logf("Failure to initialize window.\n");
return false;
}
#ifdef DARWIN
// This is a temporary hack for OS X where our size isn't getting initialized to the correct values.
int outx = 0;
int outy = 0;
glfwGetWindowSize(wnd, &outx, &outy);
ResizeFunc(wnd, outx, outy);
#endif
SetVisibleCursor(Configuration::GetSkinConfigf("ShowCursor") != 0);
return SetupWindow();
}
示例4: XRC_MAKE_INSTANCE
wxObject *wxHtmlWindowXmlHandler::DoCreateResource()
{
XRC_MAKE_INSTANCE(control, wxHtmlWindow)
control->Create(m_parentAsWindow,
GetID(),
GetPosition(), GetSize(),
GetStyle(wxT("style"), wxHW_SCROLLBAR_AUTO),
GetName());
if (HasParam(wxT("borders")))
{
control->SetBorders(GetDimension(wxT("borders")));
}
if (HasParam(wxT("url")))
{
wxString url = GetParamValue(wxT("url"));
wxFileSystem& fsys = GetCurFileSystem();
wxFSFile *f = fsys.OpenFile(url);
if (f)
{
control->LoadPage(f->GetLocation());
delete f;
}
else
control->LoadPage(url);
}
else if (HasParam(wxT("htmlcode")))
{
control->SetPage(GetText(wxT("htmlcode")));
}
SetupWindow(control);
return control;
}
示例5: CVirtualWebCam
int CARDT2Window::Init(void)
{
if(webCamNum != 1) return(0);
webCamNum = 2;
webCamList = new CWebCam*[webCamNum];
webCamList[0] = new CVirtualWebCam();
webCamList[1] = new CMainWebCam2();
scale = 1.0;
const char* cparamNames[] = {
"",
"Data/camera_para.dat",
};
char* vconfs[] = {
"",
"Data/WDM_camera_flipV_0.xml",
};
for(int i = 0; i < webCamNum; i++) {
if(!webCamList[i]->SetupWebCam(cparamNames[i], vconfs[i])) return(0);
}
webCamList[1]->dispImage = false;
width = webCamList[1]->ARTCparam.xsize;
height = webCamList[1]->ARTCparam.ysize;
aspectRatio = (double) width / (double) height;
Reshape(width, height);
vpX = 0;
vpY = 0;
SetupWindow();
return(1);
}
示例6: XRC_MAKE_INSTANCE
wxObject *wxSpinCtrlXmlHandler::DoCreateResource()
{
XRC_MAKE_INSTANCE(control, wxSpinCtrl)
control->Create(m_parentAsWindow,
GetID(),
GetText(wxT("value")),
GetPosition(), GetSize(),
GetStyle(wxT("style"), wxSP_ARROW_KEYS | wxALIGN_RIGHT),
GetLong(wxT("min"), DEFAULT_MIN),
GetLong(wxT("max"), DEFAULT_MAX),
GetLong(wxT("value"), DEFAULT_VALUE),
GetName());
const long base = GetLong(wxS("base"), 10);
if ( base != 10 )
control->SetBase(base);
SetupWindow(control);
return control;
}
示例7: wxSashWindow
wxObject* wxsSashWindow::OnBuildPreview(wxWindow* Parent,long Flags)
{
// make a thing to display
wxSashWindow *swin = new wxSashWindow(Parent,GetId(),Pos(Parent),Size(Parent),Style());
SetupWindow(swin, Flags);
// for now, a sash on all edges
swin->SetSashVisible(wxSASH_TOP, mTop);
swin->SetSashVisible(wxSASH_BOTTOM, mBottom);
swin->SetSashVisible(wxSASH_LEFT, mLeft);
swin->SetSashVisible(wxSASH_RIGHT, mRight);
// don't forget the kids
AddChildrenPreview(swin, Flags);
// done
return swin;
}
示例8: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
MSG msg; // message
bool done; // flag for when app is done
// create our window and set up OpenGL
SetupWindow("CS447-Textures", 800, 600, 32, FALSE);
done = false; // init for loop
// main message loop. note to use PeekMessage not GetMessage
while (!done)
{
// use Peek because GetMessage halts app
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) // check for a message
{
if (msg.message == WM_QUIT)
{
done = true; // if receive quit then quit
}
else
{
TranslateMessage(&msg); // translate to event queue
DispatchMessage(&msg); // dispatch to event queue
}
}
else
{
DisplayScene(); // render current scene
SwapBuffers(g_HDC); // bring back buffer to front
}
}
KillWindow(); // cleanup
return msg.wParam;
}
示例9: XRC_MAKE_INSTANCE
wxObject *kwxLinearMeterHandler::DoCreateResource()
{
// the following macro will init a pointer named "control"
// with a new instance of the MyControl class, but will NOT
// Create() it!
XRC_MAKE_INSTANCE(control, kwxLinearMeter)
control->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize());
control->ShowCurrent(GetBool(wxT("show_value"), true));
control->SetRangeVal(GetLong(wxT("range_min"), 0), GetLong(wxT("range_max"), 100));
control->ShowLimits(GetBool(wxT("show_limit_value"), true));
control->SetOrizDirection(GetBool(wxT("horizontal"), true));
control->SetActiveBarColour(GetColour(wxT("bar_colour"), *wxLIGHT_GREY));
control->SetPassiveBarColour(GetColour(wxT("background_colour"), *wxLIGHT_GREY));
control->SetBorderColour(GetColour(wxT("border_colour"), *wxBLACK));
control->SetTxtLimitColour(GetColour(wxT("range_text_colour"), *wxLIGHT_GREY));
control->SetTxtValueColour(GetColour(wxT("value_text_colour"), *wxBLACK));
control->SetTagsColour(GetColour(wxT("tag_colour"), *wxBLACK));
int i = 1;
while(1){
wxString s = wxString::Format(wxT("tag_%d_value"), i);
if(!HasParam(s)){
break;
}
control->AddTag(GetLong(s));
i++;
}
// Avoid error if the font node isn't present.
if(HasParam(wxT("font"))){
wxFont font = GetFont();
control->SetTxtFont(font);
}
control->SetValue(GetLong(wxT("value"), 0));
SetupWindow(control);
return control;
}
示例10: wxGrid
wxObject *wxGridXmlHandler::DoCreateResource()
{
wxGrid* grid = new wxGrid(m_parentAsWindow,
GetID(),
wxDefaultPosition, wxDefaultSize,
GetStyle(wxT("style"), wxWANTS_CHARS),
GetName());
long cols = GetLong (wxT("numcols"), 0);
long rows = GetLong (wxT("numrows"), 0);
if (cols && rows)
grid->CreateGrid(cols, rows, (wxGrid::wxGridSelectionModes)GetLong (wxT("selmode"), 0));
if (HasParam(wxT("size")))
grid->SetSize(GetSize());
if (HasParam(wxT("pos")))
grid->Move(GetPosition());
SetupWindow(grid);
return grid;
}
示例11: XRC_MAKE_INSTANCE
wxObject *wxWizardXmlHandler::DoCreateResource()
{
if (m_class == wxT("wxWizard"))
{
XRC_MAKE_INSTANCE(wiz, wxWizard)
long style = GetStyle(wxT("exstyle"), 0);
if (style != 0)
wiz->SetExtraStyle(style);
wiz->Create(m_parentAsWindow,
GetID(),
GetText(wxT("title")),
GetBitmap(),
GetPosition());
SetupWindow(wiz);
wxWizard *old = m_wizard;
m_wizard = wiz;
m_lastSimplePage = NULL;
CreateChildren(wiz, true /*this handler only*/);
m_wizard = old;
return wiz;
}
示例12: InitEditor
bool CMainWindow::LoadFile(LPCTSTR filename)
{
InitEditor();
FILE *fp = NULL;
_tfopen_s(&fp, filename, L"rb");
if (!fp)
return false;
//SetTitle();
char data[4096] = { 0 };
size_t lenFile = fread(data, 1, sizeof(data), fp);
bool bUTF8 = IsUTF8(data, lenFile);
while (lenFile > 0)
{
SendEditor(SCI_ADDTEXT, lenFile,
reinterpret_cast<LPARAM>(static_cast<char *>(data)));
lenFile = fread(data, 1, sizeof(data), fp);
}
fclose(fp);
SetupWindow(bUTF8);
m_filename = filename;
return true;
}
示例13: mpWindow
wxObject* wxsMathPlot::OnBuildPreview(wxWindow* Parent, long Flags)
{
mpWindow *mp;
// make a panel
mp = new mpWindow(Parent, GetId(), Pos(Parent), Size(Parent), Style());
if (mp == NULL) return NULL;
SetupWindow(mp, Flags);
// add kids
AddChildrenPreview(mp, Flags);
// and update the display
mp->UpdateAll();
mp->Fit();
// done
return mp;
}
示例14: XRC_MAKE_INSTANCE
wxObject * MaxAnimationCtrlXmlHandler::DoCreateResource()
{
XRC_MAKE_INSTANCE(ctrl, MaxAnimationCtrl)
wxScopedPtr<wxAnimation> animation(GetAnimation(wxT("animation")));
ctrl->Create(m_parentAsWindow,
GetID(),
animation ? *animation : wxNullAnimation,
GetPosition(), GetSize(),
GetStyle(wxT("style"), wxAC_DEFAULT_STYLE),
GetName());
ctrl->MaxBind(_wx_wxanimationctrl_wxAnimationCtrl__xrcNew(ctrl));
// if no inactive-bitmap has been provided, GetBitmap() will return wxNullBitmap
// which just tells wxAnimationCtrl to use the default for inactive status
ctrl->SetInactiveBitmap(GetBitmap(wxT("inactive-bitmap")));
SetupWindow(ctrl);
return ctrl;
}
示例15: XRC_MAKE_INSTANCE
wxObject *kwxAngularMeterHandler::DoCreateResource()
{
// the following macro will init a pointer named "control"
// with a new instance of the MyControl class, but will NOT
// Create() it!
XRC_MAKE_INSTANCE(control, kwxAngularMeter)
control->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize());
control->SetNumTick(GetLong(wxT("num_ticks")));
control->SetRange(GetLong(wxT("range_min"), 0), GetLong(wxT("range_max"), 220));
control->SetAngle(GetLong(wxT("angle_min"), -20), GetLong(wxT("angle_max"), 200));
int i = 1;
while(1){
wxString s = wxString::Format(wxT("sector_%d_colour"), i);
if(!HasParam(s)){
break;
}
// Setting the number of sectors each time around is not ideal but the alternative is to pre-process the XML.
control->SetNumSectors(i);
control->SetSectorColor(i - 1, GetColour(s, *wxWHITE));
i++;
}
control->DrawCurrent(GetBool(wxT("show_value"), true));
control->SetNeedleColour(GetColour(wxT("needle_colour"), *wxRED));
control->SetBackColour(GetColour(wxT("background_colour"), control->GetBackgroundColour()));
control->SetBorderColour(GetColour(wxT("border_colour"), control->GetBackgroundColour()));
// Avoid error if the font node isn't present.
if(HasParam(wxT("font"))){
wxFont font = GetFont();
control->SetTxtFont(font);
}
control->SetValue(GetLong(wxT("value"), 0));
SetupWindow(control);
return control;
}