Ejemplo n.º 1
0
#define WndPmt( wnd ) ( (pmt_window*)WndExtra( wnd ) )

enum {
    CTL_CMD_OK = 100,
    CTL_CMD_CANCEL,
    CTL_CMD_EDIT,
    CTL_CMD_HISTORY,
    CTL_CMD_CHECK,
};

#define DLG_CMD_ROWS    12
#define DLG_CMD_COLS    35

static gui_control_info Controls[] = {
    DLG_EDIT( "",             CTL_CMD_EDIT,     1,  0, 29 ),
    DLG_LIST_BOX( NULL,       CTL_CMD_HISTORY,  1,  2, 29, 5 ),

    DLG_BUTTON( "&OK",        CTL_CMD_OK,       2,  7, 12 ),
    DLG_DEFBUTTON( "&Cancel", CTL_CMD_CANCEL,   18, 7, 28 ),
    DLG_CHECK( "C&heck Me",   CTL_CMD_CHECK,    1,  9, 28 ),
};

#define NUM_CONTROLS ArraySize( Controls )

static char *Stuff[] = { "stuff1", "stuff2", "stuff3" };

static void DoCmd( char *cmd )
{
    Say( cmd );
}
Ejemplo n.º 2
0
#define DLG_FILE_ROWS   14
#define DLG_FILE_COLS   65
#define BOX_WIDTH       20
#define BOX_WIDTH2      25

#define DIR_START       27

// if dlgControls is modified then make sure the function InitDlgControls
// matches it
static gui_control_info dlgControls[] =
{
/*  0 */ DLG_STRING(    NULL, 2, 0, 11 ),
/*  1 */ DLG_STRING(    NULL, DIR_START, 0, DIR_START+12 ),
/*  2 */ DLG_EDIT(      NULL, CTL_EDIT, 2, 1, BOX_WIDTH+3 ),
/*  3 */ DLG_DYNSTRING( NULL, CTL_DIR_NAME, DIR_START, 1, DLG_FILE_COLS-1 ),
/*  4 */ DLG_LIST_BOX(  NULL, CTL_FILE_LIST,    2, 3, 2+BOX_WIDTH, 9 ),
/*  5 */ DLG_LIST_BOX(  NULL, CTL_DIR_LIST,     DIR_START, 3, DIR_START+BOX_WIDTH2, 9 ),
/*  6 */ DLG_DEFBUTTON( NULL, CTL_OK,   (DIR_START+BOX_WIDTH2+4), 4, (DIR_START+BOX_WIDTH2+14) ),
/*  7 */ DLG_BUTTON(    NULL, CTL_CANCEL,       (DIR_START+BOX_WIDTH2+4), 6, (DIR_START+BOX_WIDTH2+14) ),
/*  8 */ DLG_STRING(    NULL, 2, 11, 20 ),
/*  9 */ DLG_COMBO_BOX( NULL, CTL_FILE_TYPES, 2,12,2+BOX_WIDTH+3,15 ),
#if !defined( __UNIX__ ) && !defined( __NETWARE__ )
/* 10 */ DLG_STRING(    NULL, DIR_START+2, 11, DIR_START+8 ),
/* 11 */ DLG_COMBO_BOX( NULL, CTL_DRIVES, DIR_START+2,12,DIR_START+BOX_WIDTH,15 )
#endif
};

static bool     ControlsInitialized = false;

#define FILE_LIST_INDEX         4
#define DIR_LIST_INDEX          5