Skip to content

Commit

Permalink
Menu bar with drop down submenus working.
Browse files Browse the repository at this point in the history
Still need to adjust the alignment a bit.
Initial conditions are still wonky too.
  • Loading branch information
skaller committed Feb 27, 2015
1 parent c3121b1 commit 7ccc218
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions src/lib/gui/menu.flx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,26 @@ class FlxGuiMenu

match submenu with
| Empty => ;
| _ => println "SUBMENU SELECTED, NOT IMPLEMENTED YET";
| _ =>
if dosub do
println "SUBMENU SELECTED";
var smm = MenuModel ( submenu );
var smd = MenuDisplay (
smm,
w,
xpos,bottom_y+border_width,
font,
text_colour,
disabled_colour,
selected_colour,
submenu_icons
);
match position with
| Cons (_,?tail) => smm.set_state (Open tail);
| _ => ;
endmatch;
smd.display();
done
endmatch;
xpos = xpos + item_width + right_padding+left_padding;
++counter;
Expand Down Expand Up @@ -472,7 +491,27 @@ class FlxGuiMenu
endmatch;
match submenu with
| Empty => ;
| _ => ;
| _ =>
if dosub do
var smm = MenuModel ( submenu );
var smd = MenuDisplay (
smm,
w,
xpos,bottom_y+border_width,
font,
text_colour,
disabled_colour,
selected_colour,
submenu_icons
);
match position with
| Cons (_,?tail) => smm.set_state (Open tail);
| _ => ;
endmatch;
var shots = smd.get_hotrects();
shots = map (fun (h:rect_t,pos:menu_position_t) => (h,Cons(counter,pos) )) shots;
photrecs <- *photrecs + shots;
done
endmatch;
xpos = xpos + item_width + right_padding +left_padding;
++counter;
Expand Down

0 comments on commit 7ccc218

Please sign in to comment.