// ----------------------------------------------------------------------- // Display API functions/constants listbox void DisplayAPIWindow(long dx, long dy, HWND hWnd, CStr APIFncN) { CStr ReturnValue; long EntryIndex = 0; long MaxName = 0; long MaxName2 = 0; if((UseDbFnc == 0) && (UseDbConst == 0)) return; // Retrieve all names ChildStruct = LoadStructure(CurrentForm); APIListWidth = 0; APIListHeight = 1; CreateSplashDialog(dx, dy, APIListWidth, APIListHeight, "", ChildStruct->hChildCodeMax, NULL, NULL, &FRMAPIListInitProc, &FRMAPIListWinHook, 0, 0, SW_HIDE); ListBoxReset(APIhListBox); if(FncBase != 0) if(UseDbFnc == 1) MaxName = FillAPIListBox(APIhListBox, FncBase); if(ConstBase != 0) if(UseDbConst == 1) MaxName2 = FillAPIListBox(APIhListBox, ConstBase); if(MaxName2 > MaxName) MaxName = MaxName2; if(MaxName != 0) { // Set sizes APIListWidth = (GDIGetFontWidth(FRMAPIListhWnd, APIListhFont) * MaxName) + 2 + 1 + GetSystemMetrics(SM_CXVSCROLL); APIListHeight = (GDIGetTextHeight(FRMAPIListhWnd, APIListhFont, "hg") * DbLinesNumbers) + 2 + 1; if(dx < 0) dx = 0; if(dy < 0) dy = 0; if((dx + APIListWidth) > GetSystemMetrics(SM_CXFULLSCREEN)) dx = GetSystemMetrics(SM_CXFULLSCREEN) - APIListWidth; if((dy + APIListHeight) > GetSystemMetrics(SM_CYFULLSCREEN)) dy = GetSystemMetrics(SM_CYFULLSCREEN) - APIListHeight; // Resize and display API list now ControlResize(FRMAPIListhWnd, dx, dy, APIListWidth, APIListHeight); ControlResize(APIhListBox, 1, 1, APIListWidth - 2, APIListHeight - 2); APIXDim = APIListWidth; APIYDim = APIListHeight; // Modify index of the listbox if necessary if(APIFncN.Len() != 0) { EntryIndex = SendMessage(APIhListBox, LB_FINDSTRING, -1, (long) APIFncN.Get_String()); ListBoxSetIndex(APIhListBox, EntryIndex); ListBoxSetTopIndex(APIhListBox, EntryIndex); } else { ListBoxSetIndex(APIhListBox, -1); ListBoxSetTopIndex(APIhListBox, -1); } ControlVisible(FRMAPIListhWnd, 1); SetFocus(APIhListBox); } else { // Remove it ControlClose(FRMAPIListhWnd); } }
void CMapControl::OnSize(UINT nType, int cx, int cy) { __super::OnSize(nType, cx, cy); ControlResize(nType,cx,cy); }