X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc25a89ac1e6c5208db24bfc0abc8666b791dc6..df0dc216ad7c5ace4d80c9afc866f3c002b7b09d:/contrib/samples/ogl/studio/studio.cpp?ds=sidebyside diff --git a/contrib/samples/ogl/studio/studio.cpp b/contrib/samples/ogl/studio/studio.cpp index d8ca7a8890..14ca6ba54e 100644 --- a/contrib/samples/ogl/studio/studio.cpp +++ b/contrib/samples/ogl/studio/studio.cpp @@ -33,7 +33,7 @@ #include "project.h" #include "symbols.h" -#if defined(__WXGTK__) || defined(__WXMOTIF__) +#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) #include "bitmaps/new.xpm" #include "bitmaps/open.xpm" #include "bitmaps/save.xpm" @@ -112,10 +112,16 @@ bool csApp::OnInit(void) (void) new wxDocTemplate(m_docManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View", CLASSINFO(csDiagramDocument), CLASSINFO(csDiagramView)); - // Create the main frame window + // Create the main frame window. + // Note that we use a frame style that doesn't have wxCLIP_CHILDREN in it + // (the default frame style contains wxCLIP_CHILDREN), otherwise the client + // area doesn't refresh properly when we change its position, under Windows. + +#define wxDEFAULT_FRAME_STYLE_NO_CLIP \ + (wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION) csFrame* frame = new csFrame(m_docManager, NULL, -1, "OGL Studio", m_mainFramePos, m_mainFrameSize, - wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); + wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL); // Give it an icon frame->SetIcon(wxICON(studio)); @@ -162,9 +168,11 @@ bool csApp::OnInit(void) // The ordering of these is important for layout purposes CreateDiagramToolBar(frame); CreatePalette(frame); - CreateProjectWindow(frame); + /* + CreateProjectWindow(frame); FillProjectTreeCtrl(); + */ // Create the shape editing menu m_shapeEditMenu = new ShapeEditMenu; @@ -314,7 +322,7 @@ void csApp::InitToolBar(wxToolBar* toolBar) bitmaps[7] = new wxBitmap("help", wxBITMAP_TYPE_RESOURCE); bitmaps[8] = new wxBitmap("undo", wxBITMAP_TYPE_RESOURCE); bitmaps[9] = new wxBitmap("redo", wxBITMAP_TYPE_RESOURCE); -#elif defined(__WXGTK__) || defined(__WXMOTIF__) +#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) bitmaps[0] = new wxBitmap( new_xpm ); bitmaps[1] = new wxBitmap( open_xpm ); bitmaps[2] = new wxBitmap( save_xpm ); @@ -365,7 +373,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) win->SetDefaultSize(wxSize(10000, 30)); win->SetOrientation(wxLAYOUT_HORIZONTAL); win->SetAlignment(wxLAYOUT_TOP); - win->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); + win->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); m_diagramToolBarSashWindow = win; m_diagramToolBarSashWindow->Show(FALSE); @@ -387,7 +395,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) bitmaps[8] = new wxBitmap("newpoint", wxBITMAP_TYPE_RESOURCE); bitmaps[9] = new wxBitmap("cutpoint", wxBITMAP_TYPE_RESOURCE); bitmaps[10] = new wxBitmap("straighten", wxBITMAP_TYPE_RESOURCE); -#elif defined(__WXGTK__) || defined(__WXMOTIF__) +#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) bitmaps[0] = new wxBitmap( alignl_xpm ); bitmaps[1] = new wxBitmap( alignr_xpm ); bitmaps[2] = new wxBitmap( alignt_xpm ); @@ -436,7 +444,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) int zoomW = 60; int zoomH = 18; #ifdef __WXMOTIF__ - controlX += 70; + controlX += 75; pointSizeW = 60; pointSizeH = 22; zoomW = 60; @@ -447,6 +455,10 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) "", wxPoint(controlX, 1), wxSize(pointSizeW, pointSizeH), maxPointSize, pointSizes); delete[] pointSizes; +#ifdef __WXGTK__ + m_diagramToolBar->AddControl(m_pointSizeComboBox); +#endif + m_pointSizeComboBox->SetSelection(10 - 1); // Create a combobox for zooming @@ -466,6 +478,10 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) "", wxPoint(controlX, 1), wxSize(zoomW, zoomH), noStrings, zoomStrings); delete[] zoomStrings; +#ifdef __WXGTK__ + m_diagramToolBar->AddControl(m_zoomComboBox); +#endif + // i = (zoom - minZoom)/increment // index = noStrings - i - 1 // 100%