static void show_key_selection_popoup( HWND hwndDlg, LPARAM lParam ) { RECT rect; HMENU hpopup; struct button_info *info; BOOL menu_id; info = ( struct button_info * ) GetWindowLong( ( HWND ) lParam, GWL_USERDATA ); /* create a popup right over the button that has been clicked */ GetWindowRect( ( HWND ) lParam, &rect ); hpopup = GetSubMenu( LoadMenu( fuse_hInstance, MAKEINTRESOURCE( IDR_JOYSTICKS_POPUP ) ), 0 ); /* popup returns the key value */ menu_id = TrackPopupMenu( hpopup, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_NONOTIFY | TPM_RETURNCMD | TPM_RIGHTBUTTON, rect.left, rect.top, 0, fuse_hWnd, NULL ); if( menu_id > 0 ) { /* KEYBOARD_NONE is 0, and TrackPopupMenu returns 0 on error, so menu id for KEYBOARD_NONE is 1 to distiguish the 2 results */ if( menu_id != 1 ) info->key = menu_id; else info->key = KEYBOARD_NONE; set_key_text( info->label, info->key ); set_key_text( info->static_label, info->key ); } }
static void create_fire_button_selector( const TCHAR *title, struct button_info *info, HWND hwndDlg ) { SendMessage( info->frame, WM_SETTEXT, 0, ( LPARAM ) title ); info->key = *info->setting; set_key_text( info->label, info->key ); set_key_text( info->static_label, info->key ); SetWindowLong( info->label, GWL_USERDATA, ( LONG ) info ); }
void test_check_out_impute(){ apop_table_exists("testcheckoutbase", 'd'); apop_table_exists("testcheckoutfill", 'd'); apop_table_exists("testcheckoutbase_copy", 'd'); apop_table_exists("tcb", 'd'); apop_query("create table testcheckoutbase (id, a, b); " " insert into testcheckoutbase values(0, 3, 0./0.);" " insert into testcheckoutbase values(1, 0./0., 3);" " insert into testcheckoutbase values(2, 3, 3);" "create table testcheckoutfill (draw, value, id, field); " " insert into testcheckoutfill values(0, 3, 1, 'a');" " insert into testcheckoutfill values(0, 3, 0, 'b');" " insert into testcheckoutfill values(1, 9, 1, 'a');" " insert into testcheckoutfill values(1, 6, 0, 'b');" ); char *strings[] = {"testcheckoutbase", //0 "testcheckoutfill", //1 "testcheckoutbase_copy", //2 "tcb" //3 }; set_key_text("id", NULL, "id"); check_out_impute( strings+0, strings+2, (int[]){0}, NULL, strings+1);