// MakeKeySelectionControls(): bool FreeKeyInterface::MakeKeySelectionControls() { try { int x = CON_HOTW( select_info_area ); int y = CON_HOTH( select_info_area ); // Keyframe Selection Info if( !( key_select_info_area = AREA_CTL( panel_funcs->orig_struct, main_panel, "", x, y ) ) ) throw false; x = CON_X( select_info_area ); y = CON_Y( select_info_area ); MOVE_CON( key_select_info_area, x, y ); // Set the Draw Functions ival.intv.value = (int)&DrawKeySelectInfo; (*key_select_info_area->set)( key_select_info_area, CTL_USERDRAW, &ival ); return true; } catch( bool ) { return false; } return true; }
// Constructor PanelControls_WPopdown::PanelControls_WPopdown( GlobalFunc *_global, LWPanelID _panel, int width, const char *_title, WPopdown_Name *_name, WPopdown_Count *_count ) : global(_global), panel(_panel), title(_title), event(NULL), user_data(NULL), strings(NULL), string_count(0), count(_count), name(_name) { panel_funcs = (LWPanelFuncs *)global( LWPANELFUNCS_GLOBAL, GFUSE_ACQUIRE ); context_funcs = (ContextMenuFuncs *)global( LWCONTEXTMENU_GLOBAL, GFUSE_ACQUIRE ); control = AREA_CTL( panel_funcs, panel, "", width-2, panel_funcs->drawFuncs->dispMetrics()->textHeight + 4 ); CON_SETEVENT( control, WPopdown_ControlEvent, this ); ival.intv.value = (int)&WPopdown_ControlDraw; (*control->set)( control, CTL_USERDRAW, &ival ); menu = CONTEXT_MENU( context_funcs, WPopdown_StringName, WPopdown_StringCount, this ); }
// Constructor PanelControls_WPopdown::PanelControls_WPopdown( GlobalFunc *_global, LWPanelID _panel, int width, const char *_title, const char **_strings ) : global(_global), panel(_panel), title(_title), event(NULL), user_data(NULL), strings(_strings), string_count(0), count(NULL), name(NULL), prev_index(0) { strings = _strings; for( string_count=0; strings[ string_count ] != NULL; string_count++ ) { ; } panel_funcs = (LWPanelFuncs *)global( LWPANELFUNCS_GLOBAL, GFUSE_ACQUIRE ); raster_funcs = (LWRasterFuncs *)global( LWRASTERFUNCS_GLOBAL, GFUSE_ACQUIRE ); context_funcs = (ContextMenuFuncs *)global( LWCONTEXTMENU_GLOBAL, GFUSE_ACQUIRE ); control = AREA_CTL( panel_funcs, panel, "", width-2, panel_funcs->drawFuncs->dispMetrics()->textHeight + 4 ); CON_SETEVENT( control, WPopdown_ControlEvent, this ); ival.intv.value = (int)&WPopdown_ControlDraw; (*control->set)( control, CTL_USERDRAW, &ival ); menu = CONTEXT_MENU( context_funcs, WPopdown_StringName, WPopdown_StringCount, this ); }
// MakeItemSelectionControls(): bool FreeKeyInterface::MakeItemSelectionControls() { try { int x, y; // ItemSelection Controls if( !( select_item_name = STR_CTL( panel_funcs->orig_struct, main_panel, "Match String", 65 ) ) ) throw false; if( !( select_name_mode = WPOPUP_CTL( panel_funcs->orig_struct, main_panel, "Compare", selection_name_text, 100 ) ) ) throw false; if( !( select_toggle = WPOPUP_CTL( panel_funcs->orig_struct, main_panel, "Mode", select_toggle_text, 83 ) ) ) throw false; if( !( select_item_mode = WPOPUP_CTL( panel_funcs->orig_struct, main_panel, "", selection_mode_text, 257 ) ) ) throw false; if( !( select_children_toggle = BOOL_CTL( panel_funcs->orig_struct, main_panel, "And Children" ) ) ) throw false; if( !( apply_select_item_name = WBUTTON_CTL( panel_funcs->orig_struct, main_panel, "Apply", 100 ) ) ) throw false; SET_INT( select_item_mode, 1 ); SET_INT( select_name_mode, 1 ); SET_INT( select_children_toggle, 1 ); SET_INT( select_toggle, 0 ); PanelTools::PutUnder( tool_options_tabs, select_item_name ); x = CON_X( select_item_name ); y = CON_Y( select_item_name ); MOVE_CON( select_item_name, x, y+4 ); PanelTools::PutOnLineWith( select_item_name, select_name_mode, -2 ); PanelTools::AlignLabels( select_item_name, select_toggle ); PanelTools::PutOnLineWith( select_toggle, select_item_mode ); PanelTools::PutOnLineWith( select_item_mode, select_children_toggle ); PanelTools::PutOnLineWith( select_children_toggle, apply_select_item_name ); x = CON_X( apply_select_item_name ); int w = CON_W( apply_select_item_name ); int x2 = CON_X( item_scroll ); int w2 = CON_W( item_scroll ); int y2 = CON_HOTY( select_name_mode ); y = CON_HOTY( apply_select_item_name ); int h = CON_HOTH( apply_select_item_name ); // Item Selection Info if( !( select_info_area = AREA_CTL( panel_funcs->orig_struct, main_panel, "", (x2+w2) - (x+w) - 20, (y+h) - y2 ) ) ) throw false; PanelTools::PutOnLineWith( select_name_mode, select_info_area ); // Event Handler Functions CON_SETEVENT( apply_select_item_name, OnApplySelection, this ); CON_SETEVENT( select_item_mode, OnSelectionMode, this ); CON_SETEVENT( select_toggle, OnSelectionMode, this ); // Set the Draw Functions ival.intv.value = (int)&DrawSelectInfo; (*select_info_area->set)( select_info_area, CTL_USERDRAW, &ival ); return true; } catch( bool ) { return false; } return true; }