diff options
Diffstat (limited to 'src/Basemenu.cc')
-rw-r--r-- | src/Basemenu.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Basemenu.cc b/src/Basemenu.cc index 8ed35ef..bf031dd 100644 --- a/src/Basemenu.cc +++ b/src/Basemenu.cc | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "fluxbox.hh" | 33 | #include "fluxbox.hh" |
34 | #include "Basemenu.hh" | 34 | #include "Basemenu.hh" |
35 | #include "Screen.hh" | 35 | #include "Screen.hh" |
36 | #include "StringUtil.hh" | ||
36 | 37 | ||
37 | #ifdef HAVE_STDIO_H | 38 | #ifdef HAVE_STDIO_H |
38 | # include <stdio.h> | 39 | # include <stdio.h> |
@@ -197,8 +198,8 @@ Basemenu::~Basemenu(void) { | |||
197 | int Basemenu::insert(const char *l, int function, const char *e, int pos) { | 198 | int Basemenu::insert(const char *l, int function, const char *e, int pos) { |
198 | char *label = 0, *exec = 0; | 199 | char *label = 0, *exec = 0; |
199 | 200 | ||
200 | if (l) label = Misc::strdup(l); | 201 | if (l) label = StringUtil::strdup(l); |
201 | if (e) exec = Misc::strdup(e); | 202 | if (e) exec = StringUtil::strdup(e); |
202 | 203 | ||
203 | BasemenuItem *item = new BasemenuItem(label, function, exec); | 204 | BasemenuItem *item = new BasemenuItem(label, function, exec); |
204 | menuitems->insert(item, pos); | 205 | menuitems->insert(item, pos); |
@@ -210,7 +211,7 @@ int Basemenu::insert(const char *l, int function, const char *e, int pos) { | |||
210 | int Basemenu::insert(const char *l, Basemenu *submenu, int pos) { | 211 | int Basemenu::insert(const char *l, Basemenu *submenu, int pos) { |
211 | char *label = 0; | 212 | char *label = 0; |
212 | 213 | ||
213 | if (l) label = Misc::strdup(l); | 214 | if (l) label = StringUtil::strdup(l); |
214 | 215 | ||
215 | BasemenuItem *item = new BasemenuItem(label, submenu); | 216 | BasemenuItem *item = new BasemenuItem(label, submenu); |
216 | menuitems->insert(item, pos); | 217 | menuitems->insert(item, pos); |
@@ -507,11 +508,11 @@ void Basemenu::redrawTitle(void) { | |||
507 | l += (menu.bevel_w * 2); | 508 | l += (menu.bevel_w * 2); |
508 | 509 | ||
509 | switch (screen->getMenuStyle()->titlefont.justify) { | 510 | switch (screen->getMenuStyle()->titlefont.justify) { |
510 | case Misc::Font::RIGHT: | 511 | case DrawUtil::Font::RIGHT: |
511 | dx += menu.width - l; | 512 | dx += menu.width - l; |
512 | break; | 513 | break; |
513 | 514 | ||
514 | case Misc::Font::CENTER: | 515 | case DrawUtil::Font::CENTER: |
515 | dx += (menu.width - l) / 2; | 516 | dx += (menu.width - l) / 2; |
516 | break; | 517 | break; |
517 | default: | 518 | default: |
@@ -644,11 +645,11 @@ void Basemenu::drawItem(int index, Bool highlight, Bool clear, | |||
644 | } | 645 | } |
645 | 646 | ||
646 | switch(screen->getMenuStyle()->framefont.justify) { | 647 | switch(screen->getMenuStyle()->framefont.justify) { |
647 | case Misc::Font::LEFT: | 648 | case DrawUtil::Font::LEFT: |
648 | text_x = item_x + menu.bevel_w + menu.item_h + 1; | 649 | text_x = item_x + menu.bevel_w + menu.item_h + 1; |
649 | break; | 650 | break; |
650 | 651 | ||
651 | case Misc::Font::RIGHT: | 652 | case DrawUtil::Font::RIGHT: |
652 | text_x = item_x + menu.item_w - (menu.item_h + menu.bevel_w + text_w); | 653 | text_x = item_x + menu.item_w - (menu.item_h + menu.bevel_w + text_w); |
653 | break; | 654 | break; |
654 | default: //center | 655 | default: //center |
@@ -789,7 +790,7 @@ void Basemenu::setLabel(const char *l) { | |||
789 | if (menu.label) | 790 | if (menu.label) |
790 | delete [] menu.label; | 791 | delete [] menu.label; |
791 | 792 | ||
792 | if (l) menu.label = Misc::strdup(l); | 793 | if (l) menu.label = StringUtil::strdup(l); |
793 | else menu.label = 0; | 794 | else menu.label = 0; |
794 | } | 795 | } |
795 | 796 | ||