RE: [DUG]: Setting up the # of drop down rows from a WINDOWS Dialog Control
Sounds and Looks like a far easier method than what I did. I might even convert to that since I only want to add mainly group box's with some controls, and check box's. Thanks Chris Christopher Crowe (Software Developer) Microsoft MVP, MCP Adrock Software Byte Computer & Software LTD P.O Box 13-155 Christchurch New Zealand Phone/Fax (NZ) 03-3651-112 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Dennis Chuah > Sent: Tuesday, 6 April 1999 16:47 > To: Multiple recipients of list delphi > Subject: RE: [DUG]: Setting up the # of drop down rows from a WINDOWS > Dialog Control > > > > Chris, > > > I sort of worked something like that out looking at the D4 source > > code for the Combo Box. I came up with this bit of code below. > > > > I was doing this as part of my new Open Dialogs for a project. > > The project adds combos, checkboxs, and groups to the open dialogs. > > Have you considered looking at ExtDlgs.pas - this is the source to the > TOpenPicture / TSavePicture dialogs. It is a very good example of how you > can create Delphi controls for use on a non-Delphi form / dialog. > You might > be able to replace your combobox with the Delphi TCombobox component. > > > In order to get a dialog recource editor I had to install > > Microsoft Visual C++ which is over 300 meg, so I have a 300 meg > > resource editor. It is such a pity Borland did not think that > > Delphi developers would like such a tool, instead of providing > > such rubbish in a product called ImageEditor which has the same > > bugs since about D2, and does not edit or create resources > > anyway, except images and does that badly as well. > > I agree. Delphi ought to have a resource workshop "built in". Given the > extensible nature of Delphi, this shouldn't be too difficult for > Borland to > do. BTW, the various versions of the resource workshop in > Borland C++ also > have their bugs, some of which carry from version to version. > What we need > is a *REAL* resource editor. Any takers? > > - > Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]] > Manager, Product Development > Contec Data Systems Ltd. [http://www.contecds.com] > tel: +64-3-3580060 ext-775 fax: +64-3-3588045 > > > > -- > - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz
RE: [DUG]: Setting up the # of drop down rows from a WINDOWS Dialog Control
Chris, > I sort of worked something like that out looking at the D4 source > code for the Combo Box. I came up with this bit of code below. > > I was doing this as part of my new Open Dialogs for a project. > The project adds combos, checkboxs, and groups to the open dialogs. Have you considered looking at ExtDlgs.pas - this is the source to the TOpenPicture / TSavePicture dialogs. It is a very good example of how you can create Delphi controls for use on a non-Delphi form / dialog. You might be able to replace your combobox with the Delphi TCombobox component. > In order to get a dialog recource editor I had to install > Microsoft Visual C++ which is over 300 meg, so I have a 300 meg > resource editor. It is such a pity Borland did not think that > Delphi developers would like such a tool, instead of providing > such rubbish in a product called ImageEditor which has the same > bugs since about D2, and does not edit or create resources > anyway, except images and does that badly as well. I agree. Delphi ought to have a resource workshop "built in". Given the extensible nature of Delphi, this shouldn't be too difficult for Borland to do. BTW, the various versions of the resource workshop in Borland C++ also have their bugs, some of which carry from version to version. What we need is a *REAL* resource editor. Any takers? - Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]] Manager, Product Development Contec Data Systems Ltd. [http://www.contecds.com] tel: +64-3-3580060 ext-775 fax: +64-3-3588045 --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz
RE: [DUG]: Setting up the # of drop down rows from a WINDOWS Dialog Control
Thanks Dennis I sort of worked something like that out looking at the D4 source code for the Combo Box. I came up with this bit of code below. I was doing this as part of my new Open Dialogs for a project. The project adds combos, checkboxs, and groups to the open dialogs. In order to get a dialog recource editor I had to install Microsoft Visual C++ which is over 300 meg, so I have a 300 meg resource editor. It is such a pity Borland did not think that Delphi developers would like such a tool, instead of providing such rubbish in a product called ImageEditor which has the same bugs since about D2, and does not edit or create resources anyway, except images and does that badly as well. Cheers Chris 1019 : { Put File Dir } begin if (HiWord(WPARAM) = CBN_DROPDOWN) then begin Handle := GetDlgItem(Wnd, cmd); ControlHeight := SendDlgItemMessage(Wnd,1019, CB_GETITEMHEIGHT, -1, 0); ItemHeight := SendDlgItemMessage(Wnd,1019, CB_GETITEMHEIGHT, 0, 0)+1; ItemCount := SendDlgItemMessage(Wnd,1019, CB_GETCOUNT, 0, 0); GetWindowRect(Handle, fRect); Width := fRect.Right-fRect.Left; if ItemCount > DropDownDirectoryCount then ItemCount := DropDownDirectoryCount; if ItemCount < 1 then ItemCount := 1; SetWindowPos(Handle, 0, 0, 0, Width, ItemCount * ItemHeight+ControlHeight+4, SWP_NOMOVE + SWP_NOZORDER + SWP_NOACTIVATE + SWP_NOREDRAW + SWP_HIDEWINDOW); end; SetWindowPos(Handle, 0, 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_NOZORDER + SWP_NOACTIVATE + SWP_NOREDRAW + SWP_SHOWWINDOW); GetDlgItemText(Wnd,cmd, Buffer, 255); XPutFileDir := StrPas(Buffer); end; Christopher Crowe (Software Developer) Microsoft MVP, MCP Byte Computer & Software LTD P.O Box 13-155 Christchurch New Zealand Phone/Fax (NZ) 03-3651-112 > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Dennis Chuah > > It seems like you are using the standard Windows combobox. If this is the > case, the height of the dropdown list is dependent on the height of the > combobox control. The combobox works by creating 3 controls, 1. the > combobox control (invisible), 2. the edit control, and 3. the listbox > control. The listbox control is normally invisible. When the combobox > control is first created, the height of the listbox control is > set to height > of (1) - height of (2). > > --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz
RE: [DUG]: Setting up the # of drop down rows from a WINDOWS Dialog Control
Chris, > I wam wanting to set the # of rows a drop down combo will drop. > I have say 8 items in my drop down list, but when I open the list > only the first item is shown with some very small scroll bars. > > I am using a windows dialog box control, and programtically > filling the dialog with values using code like this. > > for Pos := 0 to Directories.Count-1 do > SendDlgItemMessage(Wnd,1019, CB_ADDSTRING, 0, > Longint(PChar(Directories.Strings[POs]))); > SetDlgItemText(Wnd,1019, pchar(PutFileDir)); > > Any ideas? It seems like you are using the standard Windows combobox. If this is the case, the height of the dropdown list is dependent on the height of the combobox control. The combobox works by creating 3 controls, 1. the combobox control (invisible), 2. the edit control, and 3. the listbox control. The listbox control is normally invisible. When the combobox control is first created, the height of the listbox control is set to height of (1) - height of (2). - Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]] Manager, Product Development Contec Data Systems Ltd. [http://www.contecds.com] tel: +64-3-3580060 ext-775 fax: +64-3-3588045 --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz