Announcement

Collapse
No announcement yet.

DDT support for standard Win32 features

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DDT support for standard Win32 features

    I've recently come across two features it seems like DDT doesn't support:

    Default button in a dialog: Functionality supported (i.e. it reacts to Enter), but it isn't drawn with the heavy black border. The docs say using %BS_DEFAULT should do this. Know issue or it it likely that I'm doing something wrong?

    Right aligned Help menu item: Doesn't seem to supported.

    Comments?

    Ketil


    Ketil

  • #2
    Ketil --
    About buttons.
    Like I understand "heavy black border" has controls with focus.
    If to start from IDE by icon click, happends really strange
    (initial Control Set Focus not works).
    But if to start by Ctrl-E or from Explorer all works like it should be.
    I think this a "feature" of IDE (for debugging not important).

    About menu - don't forget about API and resource files.
    Try, for example, this fragment

    Code:
    #Compile Exe
    #Register None
    #Dim All
    #Include "Win32API.INC"
    #Resource "C:\PBDLL60\SAMPLES\SKELETON\SKELETON.PBR"
    %IDTEXT = 101
    CallBack Function DlgProc
      If CbMsg = %WM_COMMAND And (CbCtl = %IDOK Or CbCtl = %IDCANCEL) Then _
         Dialog End CbHndl
    End Function
    Function PbMain () As Long
      Local hDlg   As Long
      Dialog New 0, "What is your name?", ,, 160, 80, %WS_SYSMENU To hDlg
      Menu Attach LoadMenu (0, "MAINMENU"), hDlg
      Control Add TextBox, hDlg, 101, "Semen", 14,  12, 134, 12
      Control Add Button, hDlg, %IDOK, "OK", 34, 32, 40, 14
      Control Add Button, hDlg, %IDCANCEL, "Cancel", 84, 32, 40, 14
      Control Set Focus hDlg, %IDOK
      Dialog Show Modal hDlg, Call DlgProc
    End Function
    ------------------

    Comment


    • #3
      Ketil;

      Try using the "custom" version of CONTROL ADD !

      Rather than CONTROL ADD BUTTON use CONTROL ADD "Button"

      By using the custom version of CONTROL ADD (which requires the control class name in quotes), you avoid any problems that DDT may have with certain styles.

      Also, make sure your Default button uses the correct ID number (1) which lets Windows know it should respond to the Enter key.




      ------------------
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        you can always programmatically change the default button...





        ------------------
        lance
        powerbasic support
        mailto:[email protected][email protected]</a>
        Lance
        mailto:[email protected]

        Comment

        Working...
        X