Menu -> MenuDef
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
typedef bool (*MenuRowUpdateEnabled)();
|
||||
|
||||
struct MenuRow
|
||||
struct MenuRowDef
|
||||
{
|
||||
int iRowCode;
|
||||
CString sName;
|
||||
@@ -21,8 +21,8 @@ struct MenuRow
|
||||
int iDefaultChoice;
|
||||
vector<CString> choices;
|
||||
|
||||
MenuRow() {}
|
||||
MenuRow( int r, CString n, MenuRowUpdateEnabled pe, EditMode s, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||
MenuRowDef() {}
|
||||
MenuRowDef( int r, CString n, MenuRowUpdateEnabled pe, EditMode s, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||
{
|
||||
iRowCode = r;
|
||||
sName = n;
|
||||
@@ -34,7 +34,7 @@ struct MenuRow
|
||||
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);
|
||||
#undef PUSH
|
||||
}
|
||||
MenuRow( int r, CString n, bool e, EditMode s, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||
MenuRowDef( int r, CString n, bool e, EditMode s, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL )
|
||||
{
|
||||
iRowCode = r;
|
||||
sName = n;
|
||||
@@ -62,12 +62,12 @@ struct MenuRow
|
||||
}
|
||||
};
|
||||
|
||||
struct Menu
|
||||
struct MenuDef
|
||||
{
|
||||
CString sClassName;
|
||||
vector<MenuRow> rows;
|
||||
vector<MenuRowDef> rows;
|
||||
|
||||
Menu( CString c, MenuRow r0=MenuRow(), MenuRow r1=MenuRow(), MenuRow r2=MenuRow(), MenuRow r3=MenuRow(), MenuRow r4=MenuRow(), MenuRow r5=MenuRow(), MenuRow r6=MenuRow(), MenuRow r7=MenuRow(), MenuRow r8=MenuRow(), MenuRow r9=MenuRow(), MenuRow r10=MenuRow(), MenuRow r11=MenuRow(), MenuRow r12=MenuRow(), MenuRow r13=MenuRow(), MenuRow r14=MenuRow(), MenuRow r15=MenuRow(), MenuRow r16=MenuRow(), MenuRow r17=MenuRow(), MenuRow r18=MenuRow(), MenuRow r19=MenuRow(), MenuRow r20=MenuRow(), MenuRow r21=MenuRow(), MenuRow r22=MenuRow(), MenuRow r23=MenuRow(), MenuRow r24=MenuRow(), MenuRow r25=MenuRow(), MenuRow r26=MenuRow(), MenuRow r27=MenuRow(), MenuRow r28=MenuRow(), MenuRow r29=MenuRow() )
|
||||
MenuDef( CString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), MenuRowDef r29=MenuRowDef() )
|
||||
{
|
||||
sClassName = c;
|
||||
#define PUSH( r ) if(!r.sName.empty()) rows.push_back(r);
|
||||
@@ -80,10 +80,10 @@ struct Menu
|
||||
class ScreenMiniMenu : public ScreenOptions
|
||||
{
|
||||
public:
|
||||
static void MiniMenu( Menu* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None );
|
||||
static void MiniMenu( MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None );
|
||||
|
||||
ScreenMiniMenu( CString sScreenClass );
|
||||
void Init( const Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel );
|
||||
void Init( const MenuDef* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel );
|
||||
|
||||
protected:
|
||||
virtual void OnChange( PlayerNumber pn );
|
||||
@@ -100,7 +100,7 @@ protected:
|
||||
ScreenMessage m_SMSendOnOK;
|
||||
ScreenMessage m_SMSendOnCancel;
|
||||
|
||||
vector<MenuRow> m_vMenuRows;
|
||||
vector<MenuRowDef> m_vMenuRows;
|
||||
|
||||
public:
|
||||
static int s_iLastRowCode;
|
||||
|
||||
Reference in New Issue
Block a user