]> code.citadel.org Git - citadel.git/commitdiff
Added a sample dummy toolbar to the app.
authorArt Cancro <ajc@citadel.org>
Sat, 13 Mar 1999 04:20:20 +0000 (04:20 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 13 Mar 1999 04:20:20 +0000 (04:20 +0000)
daphne/bitmaps/copy.xpm [new file with mode: 0644]
daphne/bitmaps/cut.xpm [new file with mode: 0644]
daphne/bitmaps/help.xpm [new file with mode: 0644]
daphne/bitmaps/new.xpm [new file with mode: 0644]
daphne/bitmaps/open.xpm [new file with mode: 0644]
daphne/bitmaps/paste.xpm [new file with mode: 0644]
daphne/bitmaps/preview.xpm [new file with mode: 0644]
daphne/bitmaps/print.xpm [new file with mode: 0644]
daphne/bitmaps/save.xpm [new file with mode: 0644]
daphne/main.cpp

diff --git a/daphne/bitmaps/copy.xpm b/daphne/bitmaps/copy.xpm
new file mode 100644 (file)
index 0000000..47565c1
--- /dev/null
@@ -0,0 +1,25 @@
+/* XPM */
+static char *copy_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 4 1",
+"  c None",
+". c Black",
+"X c Gray100",
+"o c #000080",
+/* pixels */
+"                ",
+" ......         ",
+" .XXXX..        ",
+" .XXXX.X.       ",
+" .X..X.oooooo   ",
+" .XXXXXoXXXXoo  ",
+" .X....oXXXXoXo ",
+" .XXXXXoX..Xoooo",
+" .X....oXXXXXXXo",
+" .XXXXXoX.....Xo",
+" ......oXXXXXXXo",
+"       oX.....Xo",
+"       oXXXXXXXo",
+"       ooooooooo",
+"                "
+};
diff --git a/daphne/bitmaps/cut.xpm b/daphne/bitmaps/cut.xpm
new file mode 100644 (file)
index 0000000..bfe7e95
--- /dev/null
@@ -0,0 +1,24 @@
+/* XPM */
+static char *cut_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 3 1",
+"  c None",
+". c Black",
+"X c #000080",
+/* pixels */
+"                ",
+"     .   .      ",
+"     .   .      ",
+"     .   .      ",
+"     .. ..      ",
+"      . .       ",
+"      ...       ",
+"       .        ",
+"      X.X       ",
+"      X XXX     ",
+"    XXX X  X    ",
+"   X  X X  X    ",
+"   X  X X  X    ",
+"   X  X  XX     ",
+"    XX          "
+};
diff --git a/daphne/bitmaps/help.xpm b/daphne/bitmaps/help.xpm
new file mode 100644 (file)
index 0000000..50fdb41
--- /dev/null
@@ -0,0 +1,25 @@
+/* XPM */
+static char *help_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 4 1",
+"  c None",
+". c Black",
+"X c Blue",
+"o c #000080",
+/* pixels */
+"                ",
+"     ......     ",
+"    .XXXXX..    ",
+"   .XX...oX..   ",
+"   .X..  .X..   ",
+"   .X.. .XX..   ",
+"    .. .XX..    ",
+"      .XX..     ",
+"      .X..      ",
+"      .X..      ",
+"      .o..      ",
+"       ..       ",
+"      .XX..     ",
+"      .XX..     ",
+"       ...      "
+};
diff --git a/daphne/bitmaps/new.xpm b/daphne/bitmaps/new.xpm
new file mode 100644 (file)
index 0000000..754d2d2
--- /dev/null
@@ -0,0 +1,24 @@
+/* XPM */
+static char *new_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 3 1",
+"  c None",
+". c Black",
+"X c Gray100",
+/* pixels */
+"                ",
+"   ........     ",
+"   .XXXXXX..    ",
+"   .XXXXXX.X.   ",
+"   .XXXXXX....  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   .XXXXXXXXX.  ",
+"   ...........  ",
+"                "
+};
diff --git a/daphne/bitmaps/open.xpm b/daphne/bitmaps/open.xpm
new file mode 100644 (file)
index 0000000..54748e9
--- /dev/null
@@ -0,0 +1,26 @@
+/* XPM */
+static char *open_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 5 1",
+"  c None",
+". c Black",
+"X c Yellow",
+"o c Gray100",
+"O c #bfbf00",
+/* pixels */
+"                ",
+"          ...   ",
+"         .   . .",
+"              ..",
+"  ...        ...",
+" .XoX.......    ",
+" .oXoXoXoXo.    ",
+" .XoXoXoXoX.    ",
+" .oXoX..........",
+" .XoX.OOOOOOOOO.",
+" .oo.OOOOOOOOO. ",
+" .X.OOOOOOOOO.  ",
+" ..OOOOOOOOO.   ",
+" ...........    ",
+"                "
+};
diff --git a/daphne/bitmaps/paste.xpm b/daphne/bitmaps/paste.xpm
new file mode 100644 (file)
index 0000000..69177e9
--- /dev/null
@@ -0,0 +1,27 @@
+/* XPM */
+static char *paste_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 6 1",
+"  c None",
+". c Black",
+"X c Yellow",
+"o c #808080",
+"O c #000080",
+"+ c Gray100",
+/* pixels */
+"                ",
+"     ....       ",
+" .....XX.....   ",
+".ooo.X..X.ooo.  ",
+".oo.      .oo.  ",
+".oo........oo.  ",
+".oooooooooooo.  ",
+".oooooOOOOOOO.  ",
+".oooooO+++++OO  ",
+".oooooO+++++O+O ",
+".oooooO+OOO+OOO ",
+".oooooO+++++++O ",
+".oooooO+OOOOO+O ",
+" .....O+++++++O ",
+"      OOOOOOOOO "
+};
diff --git a/daphne/bitmaps/preview.xpm b/daphne/bitmaps/preview.xpm
new file mode 100644 (file)
index 0000000..0dfdca4
--- /dev/null
@@ -0,0 +1,26 @@
+/* XPM */
+static char *preview_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 5 1",
+"  c Black",
+". c None",
+"X c Gray100",
+"o c #808080",
+"O c Cyan",
+/* pixels */
+"         .......",
+" XXXXXXX  ......",
+" XXXXXXX . .....",
+" XXXXXXX    ....",
+" XXXXXXXXXX ....",
+" XXXXXXX    ....",
+" XXXXXX o..o ...",
+" XXXXX oOO.oo ..",
+" XXXXX .O..o. ..",
+" XXXXX ....o. ..",
+" XXXXX o..Ooo ..",
+" XXXXXX o..o o..",
+" XXXXXXX    o  .",
+" XXXXXXXXXX .   ",
+"            ..  "
+};
diff --git a/daphne/bitmaps/print.xpm b/daphne/bitmaps/print.xpm
new file mode 100644 (file)
index 0000000..3c2e2be
--- /dev/null
@@ -0,0 +1,26 @@
+/* XPM */
+static char *print_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 5 1",
+"  c None",
+". c Black",
+"X c Gray100",
+"o c #808000",
+"O c Yellow",
+/* pixels */
+"                ",
+"     .........  ",
+"    .XXXXXXXX.  ",
+"    .X.....X.   ",
+"   .XXXXXXXX.   ",
+"   .X.....X.... ",
+"  .XXXXXXXX. . .",
+" .......... . ..",
+".          . . .",
+".............  .",
+".      ooo  . . ",
+".      OOO  ... ",
+"............. . ",
+" .         . .  ",
+"  ...........   "
+};
diff --git a/daphne/bitmaps/save.xpm b/daphne/bitmaps/save.xpm
new file mode 100644 (file)
index 0000000..01b18f9
--- /dev/null
@@ -0,0 +1,25 @@
+/* XPM */
+static char *save_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"16 15 4 1",
+"  c None",
+". c Black",
+"X c #808000",
+"o c #808080",
+/* pixels */
+"                ",
+" .............. ",
+" .X.        . . ",
+" .X.        ... ",
+" .X.        .X. ",
+" .X.        .X. ",
+" .X.        .X. ",
+" .X.        .X. ",
+" .XX........oX. ",
+" .XXXXXXXXXXXX. ",
+" .XX.........X. ",
+" .XX......  .X. ",
+" .XX......  .X. ",
+" .XX......  .X. ",
+"  ............. "
+};
index 60391ea428712957949558ea2855f3fb47078ff5..c8d33c44b1c2c4a6b7c48854fb28356a3e678698 100644 (file)
@@ -9,6 +9,15 @@
 
 #include "includes.hpp"
 
+#include "bitmaps/new.xpm"
+#include "bitmaps/open.xpm"
+#include "bitmaps/save.xpm"
+#include "bitmaps/copy.xpm"
+#include "bitmaps/cut.xpm"
+#include "bitmaps/paste.xpm"
+#include "bitmaps/print.xpm"
+#include "bitmaps/help.xpm"
+
 
 
 // Globals
@@ -48,6 +57,7 @@ private:
        void OnUsersMenu(wxCommandEvent& cmd);
        void OnWindowMenu(wxCommandEvent& cmd);
        wxButton *do_cmd;
+       void InitToolBar(wxToolBar* toolBar);
 
        who *TheWholist;
 
@@ -152,6 +162,10 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 
        TheWholist = NULL;
 
+
+       CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
+       InitToolBar(GetToolBar());
+
        // create a menu bar
        wxMenu *menuFile = new wxMenu;
        menuFile->Append(MENU_CONNECT, "&Connect");
@@ -191,6 +205,62 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
 }
 
 
+
+// The toolbar for this application.
+// Right now we aren't defining any toolbars yet, so 
+
+void MyFrame::InitToolBar(wxToolBar* toolBar) {
+       int i;
+       wxBitmap* bitmaps[8];
+       int width = 16;
+       int currentX = 5;
+
+       bitmaps[0] = new wxBitmap( new_xpm );
+       bitmaps[1] = new wxBitmap( open_xpm );
+       bitmaps[2] = new wxBitmap( save_xpm );
+       bitmaps[3] = new wxBitmap( copy_xpm );
+       bitmaps[4] = new wxBitmap( cut_xpm );
+       bitmaps[5] = new wxBitmap( paste_xpm );
+       bitmaps[6] = new wxBitmap( print_xpm );
+       bitmaps[7] = new wxBitmap( help_xpm );
+
+       toolBar->AddTool(0, *bitmaps[0], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "New file");
+       currentX += width + 5;
+       toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Open file");
+       currentX += width + 5;
+       toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Save file");
+       currentX += width + 5;
+       toolBar->AddSeparator();
+       toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Copy");
+       currentX += width + 5;
+       toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Cut");
+       currentX += width + 5;
+       toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Paste");
+       currentX += width + 5;
+       toolBar->AddSeparator();
+       toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, FALSE,
+                       currentX, -1, (wxObject *) NULL, "Print");
+       currentX += width + 5;
+       toolBar->AddSeparator();
+       toolBar->AddTool(7, *bitmaps[7], wxNullBitmap, TRUE,s
+                currentX, -1, (wxObject *) NULL, "Help");
+
+       toolBar->Realize();
+
+       for (i = 0; i < 8; i++)
+               delete bitmaps[i];
+}
+
+
+
+
+
 // Event handlers.
 // We really could handle all menu items in one function, but that would
 // get kind of confusing, so we break it down by top-level menus.