]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor optical changes to toolbar and wxHelpFrame.
authorRobert Roebling <robert@roebling.de>
Tue, 7 Dec 1999 14:54:32 +0000 (14:54 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 7 Dec 1999 14:54:32 +0000 (14:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/tbargtk.cpp
src/gtk1/tbargtk.cpp
src/html/bitmaps/wbkadd.xpm
src/html/bitmaps/wfolder.xpm
src/html/helpfrm.cpp

index 1e0f1d9f5f76bd2528dc135e1ce31db87269cfc3..7df75acd3a96e474feecc10da9f0cf03f77f3712 100644 (file)
@@ -178,8 +178,7 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
     m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
                                               GTK_TOOLBAR_ICONS ) );
 
-//    gtk_toolbar_set_space_style( m_toolbar, GTK_TOOLBAR_SPACE_LINE );
-    m_separation = 5;
+    m_separation = 7;
     gtk_toolbar_set_space_size( m_toolbar, m_separation );
     m_hasToolAlready = FALSE;
 
@@ -330,8 +329,8 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
 
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
-    m_width = req.width;
-    m_height = req.height;
+    m_width = req.width + m_xMargin;
+    m_height = req.height + 2*m_yMargin + 4;
 
     gtk_signal_connect( GTK_OBJECT(tool->m_item),
                         "enter_notify_event", 
@@ -359,8 +358,8 @@ bool wxToolBar::AddControl(wxControl *control)
     
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
-    m_width = req.width;
-    m_height = req.height;
+    m_width = req.width + m_xMargin;
+    m_height = req.height + 2*m_yMargin + 4;
 
     m_tools.Append( tool );
     
@@ -401,26 +400,6 @@ void wxToolBar::ClearTools()
 
 bool wxToolBar::Realize()
 {
-    m_x = 0;
-    m_y = 0;
-    m_width = 100;
-    m_height = 0;
-  
-    wxNode *node = m_tools.First();
-    while (node)
-    {
-        wxToolBarTool *tool = (wxToolBarTool*)node->Data();
-        if (tool->m_bitmap1.Ok())
-        {
-            int tool_height = tool->m_bitmap1.GetHeight();
-            if (tool_height > m_height) m_height = tool_height;
-        }
-    
-        node = node->Next();
-    }
-  
-    m_height += 5 + 2*m_yMargin;
-   
     return TRUE;
 }
 
@@ -536,7 +515,7 @@ void wxToolBar::SetMargins( int x, int y )
 {
     wxCHECK_RET( !m_hasToolAlready, wxT("wxToolBar::SetMargins must be called before adding tool.") );
     
-    if (x > 2) gtk_toolbar_append_space( m_toolbar );  // oh well
+    if (x > 1) gtk_toolbar_append_space( m_toolbar );  // oh well
     
     m_xMargin = x;
     m_yMargin = y;
index 1e0f1d9f5f76bd2528dc135e1ce31db87269cfc3..7df75acd3a96e474feecc10da9f0cf03f77f3712 100644 (file)
@@ -178,8 +178,7 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
     m_toolbar = GTK_TOOLBAR( gtk_toolbar_new( GTK_ORIENTATION_HORIZONTAL,
                                               GTK_TOOLBAR_ICONS ) );
 
-//    gtk_toolbar_set_space_style( m_toolbar, GTK_TOOLBAR_SPACE_LINE );
-    m_separation = 5;
+    m_separation = 7;
     gtk_toolbar_set_space_size( m_toolbar, m_separation );
     m_hasToolAlready = FALSE;
 
@@ -330,8 +329,8 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap,
 
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
-    m_width = req.width;
-    m_height = req.height;
+    m_width = req.width + m_xMargin;
+    m_height = req.height + 2*m_yMargin + 4;
 
     gtk_signal_connect( GTK_OBJECT(tool->m_item),
                         "enter_notify_event", 
@@ -359,8 +358,8 @@ bool wxToolBar::AddControl(wxControl *control)
     
     GtkRequisition req;
     (* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
-    m_width = req.width;
-    m_height = req.height;
+    m_width = req.width + m_xMargin;
+    m_height = req.height + 2*m_yMargin + 4;
 
     m_tools.Append( tool );
     
@@ -401,26 +400,6 @@ void wxToolBar::ClearTools()
 
 bool wxToolBar::Realize()
 {
-    m_x = 0;
-    m_y = 0;
-    m_width = 100;
-    m_height = 0;
-  
-    wxNode *node = m_tools.First();
-    while (node)
-    {
-        wxToolBarTool *tool = (wxToolBarTool*)node->Data();
-        if (tool->m_bitmap1.Ok())
-        {
-            int tool_height = tool->m_bitmap1.GetHeight();
-            if (tool_height > m_height) m_height = tool_height;
-        }
-    
-        node = node->Next();
-    }
-  
-    m_height += 5 + 2*m_yMargin;
-   
     return TRUE;
 }
 
@@ -536,7 +515,7 @@ void wxToolBar::SetMargins( int x, int y )
 {
     wxCHECK_RET( !m_hasToolAlready, wxT("wxToolBar::SetMargins must be called before adding tool.") );
     
-    if (x > 2) gtk_toolbar_append_space( m_toolbar );  // oh well
+    if (x > 1) gtk_toolbar_append_space( m_toolbar );  // oh well
     
     m_xMargin = x;
     m_yMargin = y;
index 2590275e572a5698335edc6b237f955a5d46adfa..6a5c7d07c7cddcfdd80ed7511cdd2f6f8c9f0067 100644 (file)
@@ -7,16 +7,16 @@ static char * wbkadd_xpm[] = {
 "                ",
 "      ...       ",
 "      ...       ",
-"      ...++     ",
-"      ...++     ",
-"      ...++     ",
+"      ...+      ",
+"      ...+      ",
+"      ...+      ",
 " .............  ",
 " .............  ",
-" .............++",
-"   +++...+++++++",
-"   +++...+++++++",
-"      ...++     ",
-"      ...++     ",
-"      ...++     ",
-"        +++     ",
-"        +++     "};
+" .............+ ",
+"   +++...++++++ ",
+"      ...+      ",
+"      ...+      ",
+"      ...+      ",
+"      ...+      ",
+"        ++      ",
+"                "};
index 228b48a420a7610e1a78cf9f85fc18cc6489ebb9..b9283ebfb75fdbc18918fbb1fc588cf20937679c 100644 (file)
@@ -1,50 +1,25 @@
 /* XPM */
 static char * wfolder_xpm[] = {
-"16 16 31 1",
-"      c None",
+/* width height ncolors chars_per_pixel */
+"16 16 3 1",
+/* colors */
+"      s None  c None",
 ".     c #000000",
-"+     c #7F6E54",
-"@     c #555555",
-"#     c #7F6140",
-"$     c #FFCF94",
-"%     c #FFFFFF",
-"&     c #D5D5D5",
-"*     c #4B4336",
-"=     c #FFDCA8",
-"-     c #BFA57E",
-";     c #EFEFEF",
-">     c #DFDFDF",
-",     c #B8B8B9",
-"'     c #6E6E6F",
-")     c #BF7E42",
-"!     c #FFA858",
-"~     c #FFC280",
-"{     c #CFCFCF",
-"]     c #55402C",
-"^     c #3C2C2C",
-"/     c #7F542C",
-"(     c #C0C0C0",
-"_     c #B0B0B2",
-":     c #969698",
-"<     c #A8A8AB",
-"[     c #A0A0A4",
-"}     c #2C2C2C",
-"|     c #7C7C7E",
-"1     c #161616",
-"2     c #3F2A16",
-" .+.            ",
-".@#$+.          ",
-".%&@#$+.+*      ",
-".%%%&@#$==-.    ",
-".%%;>,')!~$+    ",
-".%;>{{,']^/~.   ",
-".;>{{((,,_:]/   ",
-".>{{((,,_<[}/   ",
-".{{((,,_<[[^/   ",
-"._((,,_<[[[}/   ",
-" }|_,_<[[[[}/   ",
-"  .}|<[[[[[}/   ",
-"    .}|[[[[}/   ",
-"      .}|[[}/.. ",
-"        .}|}/.. ",
-"          .12.  "};
+"+     c #ffffff",
+/* pixels */
+"                ",
+"   ...........  ",
+"   .+++++++++.  ",
+"   .++..++..+.  ",
+" ........++++.  ",
+" .++++++..+.+.  ",
+" .+.+.++.+.++.  ",
+" .++++++....+.  ",
+" .+.+.+++++.+.  ",
+" .+++++++++.+.  ",
+" .+.+.+.+.+.+.  ",
+" .+++++++++.+.  ",
+" .+.+.+.+.+...  ",
+" .+++++++++.    ",
+" ...........    ",
+"                "};
index 52cc30e279852a566c95d9673ae162f53969ce08..08bf9f3de77da7d03826d71cc98314618a95f6ab 100644 (file)
@@ -166,7 +166,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti
     // toolbar?
     if (style & wxHF_TOOLBAR) {
         wxToolBar *toolBar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_DOCKABLE);
-        toolBar -> SetMargins(2, 2);
+        toolBar->SetMargins( 2, 2 );
 
         toolBar -> AddTool(wxID_HTML_PANEL, wxBITMAP(wpanel), wxNullBitmap,
                            FALSE, -1, -1, (wxObject *) NULL,
@@ -188,6 +188,9 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti
                 m_Bookmarks -> Append(m_BookmarksNames[i]);
             m_Bookmarks -> SetSelection(0);
             toolBar -> AddControl(m_Bookmarks);
+#ifdef __WXGTK__
+            toolBar -> AddSeparator();
+#endif
             toolBar -> AddTool(wxID_HTML_BOOKMARKSADD, wxBITMAP(wbkadd), wxNullBitmap,
                                FALSE, -1, -1, (wxObject *) NULL,
                                _("Add current page to bookmarks"));