Help with DDTs 
Author Message
 Help with DDTs

Hi,

  Ok... my turn to ask the questions. <grin>

I'm building a (my first) dialog box and I've got 6 CHECKBOXes and 2 BUTTONs.
This part is working but I want to add a collapsible file selection box that
will allow the user to roam the drives at will. It should display the current
selection (if any), allow manual input, and have one of those [...] buttons on
the right of it to expand itself.

Also, is there a way to have a CHECKBOX default to "ON" and, if so, how is
that done?

Any help???

--
C'ya,

  Don Schullian
www.DASoftVSS.com
www.basicguru.com



Fri, 26 Sep 2003 16:54:45 GMT  
 Help with DDTs

Quote:
> I'm building a (my first) dialog box and I've got 6 CHECKBOXes and 2
BUTTONs.
> This part is working but I want to add a collapsible file selection box
that
> will allow the user to roam the drives at will. It should display the
current
> selection (if any), allow manual input, and have one of those [...]
buttons on
> the right of it to expand itself.

Three ways...

1. Add a list box control and send it an LB_DIR message; from the MSDN:

"An application sends an LB_DIR message to a list box to add names to the
list displayed by the list box. The message adds the names of directories
and files that match a specified string and set of file attributes. LB_DIR
can also add mapped drive letters to the list box." To send this message,
call the SendMessage function with the following parameters....

2. Use the GetOpenFileName API call. (Headers are in the COMMCTRL.INC file)
(I use this a lot).

3. If you need ONLY a directory, you can use SHBrowseForFolder..

Quote:
> Also, is there a way to have a CHECKBOX default to "ON" and, if so, how is
> that done?

I don't think you can create it that way, but you can use this API call
before you show the containing dialog:

CheckDlgButton
The CheckDlgButton function changes the check state of a button control in a
dialog:

BOOL CheckDlgButton(
  HWND hDlg,      // handle to dialog box
  int nIDButton,  // button identifier
  UINT uCheck     // check state  (BST_CHECKED, BST_UNCHECKED)

Or you can send a message to the control using sendmessage:

An application sends a BM_SETCHECK message to set the check state of a radio
button or check box.

SendMessage(
  (HWND) hWnd,              // handle to destination window
  BM_SETCHECK,              // message to send
  (WPARAM) wParam,          // check state
  (LPARAM) lParam          // not used; must be zero
);

(Same parameters for wparam as for uCheck)

One thing, Don, if you are using powerbasic (assumed, since this is that newsgroup), it will help if you mention if you are us
ing "SDK-s tyle" (API calls) or "DDT-Style" for your controls. (Duh, I just
looked at the title of the message. I guess you are using DDT. Well, you end
up doing a lot of CONTROL SEND ...   with DDT, which is the same as the
SendMessage API.)

Using DDT, I think on the button deal you can use  CONTROL SET CHECK  before
you do the DIALOG SHOW MODAL|MODELESS.

--
Michael Mattias
Tal Systems
Racine WI USA


Quote:
> Hi,

>   Ok... my turn to ask the questions. <grin>



Fri, 26 Sep 2003 22:06:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. help! f90.help help help help

2. ***HELP***HELP***NEED INFORMATION***HELP***HELP

3. HELP HELP HELP HELP

4. HELP HELP HELP HELP

5. Ord Function HELP Please HELP HELP HELP

6. help help help help!!!!!!!!!!!

7. (HELP (HELP (HELP (HELP))))

8. HELP: HELP: HELP: HELP: Online-manual on Expect

9. Help Help Help

10. TopSpeed - ODBC 3.1???? HELP HELP HELP

11. HELP - HELP - HELP

12. HELP HELP HELP - round function error

 

 
Powered by phpBB® Forum Software