#endif
#ifdef IMPLEMENTATION
-void setSelectedListBox(entity me, float i)
+void ListBox_setSelected(entity me, float i)
{
me.selectedItem = floor(0.5 + bound(0, i, me.nItems - 1));
}
-void resizeNotifyListBox(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
+void ListBox_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
{
- resizeNotifyItem(me, relOrigin, relSize, absOrigin, absSize);
+ SUPER(ListBox).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
me.controlWidth = me.scrollbarWidth / absSize_x;
}
-void configureListBoxListBox(entity me, float theScrollbarWidth, float theItemHeight)
+void ListBox_configureListBox(entity me, float theScrollbarWidth, float theItemHeight)
{
me.scrollbarWidth = theScrollbarWidth;
me.itemHeight = theItemHeight;
}
-float keyDownListBox(entity me, float key, float ascii, float shift)
+float ListBox_keyDown(entity me, float key, float ascii, float shift)
{
me.dragScrollTimer = time;
if(key == K_MWHEELUP)
return 0;
return 1;
}
-float mouseDragListBox(entity me, vector pos)
+float ListBox_mouseDrag(entity me, vector pos)
{
float hit;
float i;
}
return 1;
}
-float mousePressListBox(entity me, vector pos)
+float ListBox_mousePress(entity me, vector pos)
{
if(pos_x < 0) return 0;
if(pos_y < 0) return 0;
}
return 1;
}
-float mouseReleaseListBox(entity me, vector pos)
+float ListBox_mouseRelease(entity me, vector pos)
{
vector absSize;
if(me.pressed == 1)
me.pressed = 0;
return 1;
}
-void updateControlTopBottomListBox(entity me)
+void ListBox_updateControlTopBottom(entity me)
{
float f;
// scrollPos is in 0..1 and indicates where the "page" currently shown starts.
}
}
}
-void drawListBox(entity me)
+void ListBox_draw(entity me)
{
float i;
vector absSize, fillSize;
draw_ClearClip();
}
-void clickListBoxItemListBox(entity me, float i, vector where)
+void ListBox_clickListBoxItem(entity me, float i, vector where)
{
// itemclick, itemclick, does whatever itemclick does
}
-void drawListBoxItemListBox(entity me, float i, vector absSize, float selected)
+void ListBox_drawListBoxItem(entity me, float i, vector absSize, float selected)
{
draw_Text('0 0 0', strcat("Item ", ftos(i)), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0);
}