Announcement

Collapse
No announcement yet.

Control Add

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

  • Control Add

    With a simple DDT program (address.bas will do) when I try to add the following:
    Control Add "msctls_statusbar32",hDlg&,%SBar,0,0,0,0,%Ws_Child Or %Ws_Visible
    When I insert the 'Control Add' after a 'Menu Attach ....', everything goes fine ( a statusbar is drawn ). If I insert the line before 'Menu Attach ....', the statusbar isn't drawn.... I know the menu attach does a screen redraw, but why does it remove the statusbar?
    (I do InitCommonControls / InitCommonControlsEx)

    Peter.
    Regards,
    Peter

  • #2
    I haven't tried it that way, I know I ran into some complications so this was my workaround:

    Code:
      Menu Attach mMenu, hDlg
    
      SetTimer  hDlg, %IDT_TIMER1, 1000, ByVal %NULL  'How often to check if it's time to go hit the Atomic Clock
      hStatus = CreateStatusWindow(%WS_CHILD Or %WS_CLIPSIBLINGS Or %WS_DLGFRAME Or %WS_VISIBLE _
                                     Or %SBS_SIZEGRIP,"", hDlg, 200)
      Dialog Show Modal hDlg Call DialogProc
    -------------
    Scott Turchin


    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      Interesting,
      I put this BEFORE Menu Attach:

      Code:
        Control Add "msctls_statusbar32", hDlg,hStatus,"",0,0,0,0,_
                    %WS_CHILD Or %WS_CLIPSIBLINGS Or %WS_DLGFRAME Or %WS_VISIBLE Or %SBS_SIZEGRIP
      
      I tried putting the size - 20 for the size of it, didn't matter..
      
      'But this has to go in WM_INITDIALOG for it to resize properly after creation...
               Control Send hDlg,hStatus, %WM_SIZE, wParam, lParam
               'But this sure is nice, no varptr here   
               Control Set Text hDlg, hStatus, Mine + " " + Ver + " " + Copyrite
      -------------
      Scott Turchin




      [This message has been edited by Scott Turchin (edited January 10, 2000).]
      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


      • #4
        The usual way is to intercept %WM_SIZE messages in your dialog callback, and send a %WM_SIZE message to the statusbar in response.

        IOW, you need to forward the %WM_SIZE message everytime your callback receives one, not just at creation time (especially if your parent dialog is resizable).


        -------------
        Lance
        PowerBASIC Support
        ( mailto:[email protected][email protected]</A> )
        Lance
        mailto:[email protected]

        Comment

        Working...
        X