X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e08b761b0c5ecb6df295785b78f1f3637331887..05f9197a346867069e89558a4e663cf54b2fd23b:/contrib/samples/fl/fl_demo1/fl_demo1.cpp?ds=sidebyside diff --git a/contrib/samples/fl/fl_demo1/fl_demo1.cpp b/contrib/samples/fl/fl_demo1/fl_demo1.cpp index 86641ceab3..2959b41b3b 100644 --- a/contrib/samples/fl/fl_demo1/fl_demo1.cpp +++ b/contrib/samples/fl/fl_demo1/fl_demo1.cpp @@ -31,15 +31,15 @@ #include "wx/fl/controlbar.h" // core API // extra plugins -#include "wx/fl/barhintspl.h" // beveal for bars with "X"s and grooves -#include "wx/fl/rowdragpl.h" // NC-look with dragable rows +#include "wx/fl/barhintspl.h" // bevel for bars with "X"s and grooves +#include "wx/fl/rowdragpl.h" // NC-look with draggable rows #include "wx/fl/cbcustom.h" // customization plugin #include "wx/fl/hintanimpl.h" -// beuty-care +// beauty-care #include "wx/fl/gcupdatesmgr.h" // smooth d&d #include "wx/fl/antiflickpl.h" // double-buffered repaint of decorations -#include "wx/fl/dyntbar.h" // auto-layouting toolbar +#include "wx/fl/dyntbar.h" // auto-layout toolbar #include "wx/fl/dyntbarhnd.h" // control-bar dimension handler for it #include "fl_demo1.h" @@ -78,8 +78,8 @@ bool MyApp::OnInit(void) SetTopWindow(frame); - wxMessageBox("Hello, this demo has a bunch of yet-not-fixed-bugs and misssing functionality\n" \ - "The ONLY purpose is to demostrate self-layouting toolbars,\nflat-bitmapped-buttons and 2-new FL-plugins" \ + wxMessageBox("Hello, this demo has a bunch of yet-not-fixed-bugs and missing functionality\n" \ + "The ONLY purpose is to demonstrate self-layouting toolbars,\nflat-bitmapped-buttons and 2-new FL-plugins" \ "(cbRowDragPlugin & cbBarHintsPlugin)\n\n" \ "BTW, disabled images and label-text are rendered at run-time" ); @@ -134,7 +134,7 @@ MyFrame::MyFrame(wxFrame *frame) mpLayout = new wxFrameLayout( this, mpClientWnd ); -#ifdef __WXGTK__ +#if defined(__WXGTK__) || defined(__WXX11__) cbCommonPaneProperties props; mpLayout->GetPaneProperties( props ); @@ -151,7 +151,7 @@ MyFrame::MyFrame(wxFrame *frame) // setup plugins for testing mpLayout->PushDefaultPlugins(); - mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // facny "X"es and beveal for bars + mpLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // fancy "X"es and bevel for bars mpLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) ); mpLayout->AddPlugin( CLASSINFO( cbRowDragPlugin ) ); mpLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) ); @@ -174,9 +174,9 @@ MyFrame::MyFrame(wxFrame *frame) 4 // horizontal gap (bar border) ); - cbDimInfo sizes2( 175,45, // when docked horizontally - 175,37, // when docked vertically - 170,35, // when floated + cbDimInfo sizes2( 195,35, // when docked horizontally + 185,37, // when docked vertically + 195,35, // when floated TRUE, // the bar is not fixed-size 4, // vertical gap (bar border) 4, // horizontal gap (bar border) @@ -187,7 +187,7 @@ MyFrame::MyFrame(wxFrame *frame) sizes0, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc) 0, // insert into 0th row (vert. position) 0, // offset from the start of row (in pixels) - "InfoViewer1", // name to refere in customization pop-ups + "InfoViewer1", // name to refer in customization pop-ups TRUE ); @@ -195,7 +195,7 @@ MyFrame::MyFrame(wxFrame *frame) sizes0, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc) 1, // insert into 0th row (vert. position) 0, // offset from the start of row (in pixels) - "InfoViewer2", // name to refere in customization pop-ups + "InfoViewer2", // name to refer in customization pop-ups TRUE ); @@ -203,7 +203,7 @@ MyFrame::MyFrame(wxFrame *frame) sizes1, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc) 0, // insert into 0th row (vert. position) 0, // offset from the start of row (in pixels) - "ToolBar1", // name to refere in customization pop-ups + "ToolBar1", // name to refer in customization pop-ups TRUE ); @@ -212,11 +212,12 @@ MyFrame::MyFrame(wxFrame *frame) pToolBar->Create( this, -1 ); // 1001-1006 ids of command events fired by added tool-buttons - + pToolBar->AddTool( 1001, BMP_DIR "new.bmp" ); + pToolBar->AddSeparator(); pToolBar->AddTool( 1002, BMP_DIR "open.bmp" ); pToolBar->AddTool( 1003, BMP_DIR "save.bmp" ); - + pToolBar->AddSeparator(new wxMySeparatorLine(pToolBar, -1)); pToolBar->AddTool( 1004, BMP_DIR "cut.bmp" ); pToolBar->AddTool( 1005, BMP_DIR "copy.bmp" ); pToolBar->AddTool( 1006, BMP_DIR "paste.bmp" ); @@ -226,11 +227,11 @@ MyFrame::MyFrame(wxFrame *frame) sizes2, FL_ALIGN_TOP, // alignment ( 0-top,1-bottom, etc) 0, // insert into 0th row (vert. position) 0, // offset from the start of row (in pixels) - "ToolBar2", // name to refere in customization pop-ups + "ToolBar2", // name to refer in customization pop-ups FALSE ); - mpLayout->EnableFloating( TRUE ); // off, thinking bout wxGtk... + mpLayout->EnableFloating( TRUE ); // off, thinking about wxGtk... } MyFrame::~MyFrame() @@ -239,3 +240,21 @@ MyFrame::~MyFrame() delete mpLayout; // should be destroyed manually } +#define LINE_SIZE 3 +void wxMySeparatorLine::DoSetSize( int x, int y, + int width, int height, + int sizeFlags) +{ + if (width < height) + { + x += (width - LINE_SIZE) / 2; + width = LINE_SIZE; + } + else + { + y += (height - LINE_SIZE) / 2; + height = LINE_SIZE; + } + + wxStaticLine::DoSetSize(x, y, width, height, sizeFlags); +}