// // Update the combobox when a field has been sized, // or when there is a scroll in the container // VOID ContainerUpdateCombo(HWND hwndCnt) { LPGENCNTRDATA lpGenCntrData; lpGenCntrData = GetGenericCntrData(hwndCnt); if (!lpGenCntrData) return; if (lpGenCntrData->hWndCombo) { //SubClassEnd(); DestroyWindow(lpGenCntrData->hWndCombo); lpGenCntrData->hWndCombo = 0; lpGenCntrData->lastSel = 0; // Simulate Selection change to recreate the combo ContainerNewSel(hwndCnt); } }
static void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { // Emb July 01, 97: found Useless and even gpfs with new container // since it sends notification messages BEFORE initdialog had a chance // to allocate dialog property //LPSTORAGEPARAMS lpstructure = GetDlgProp (hwnd); switch (id) { case IDOK: if (FillStructureFromControls (hwnd)) EndDialog (hwnd, TRUE); else break; break; case IDCANCEL: EndDialog (hwnd, FALSE); break; case IDC_RELOCATE_CONTAINER: switch (codeNotify) { case CN_RECSELECTED: // // Selection has changed // ContainerNewSel (hwndCtl); break; case CN_FLDSIZED: case CN_HSCROLL_PAGEUP: case CN_HSCROLL_PAGEDOWN: case CN_HSCROLL_LINEUP: case CN_HSCROLL_LINEDOWN: case CN_HSCROLL_THUMBPOS: ContainerUpdateCombo (hwndCtl); break; default: break; } break; } }
static BOOL FillStructureFromControls (HWND hwnd) { int i; char buffer [MAXOBJECTNAME]; LPOBJECTLIST list = NULL, obj; LPSTORAGEPARAMS lpstorage = GetDlgProp (hwnd); HWND hwndContainer = GetDlgItem (hwnd, IDC_RELOCATE_CONTAINER); // Mandatory in case current cell is a combo ContainerNewSel(hwndContainer); for (i=1; i<= nLine; i++) { ZEROINIT (buffer); ContainerGetComboCellSelection (hwndContainer, i, 1, buffer); obj = AddListObjectTail (&list, x_strlen (buffer) +1); if (obj) { x_strcpy ((UCHAR *)obj->lpObject, buffer); //list = obj; } else { FreeObjectList (list); list = NULL; return FALSE; } } FreeObjectList (lpstorage->lpNewLocations); lpstorage->lpNewLocations = NULL; lpstorage->lpNewLocations = list; return TRUE; }