Announcement

Collapse
No announcement yet.

Control Add

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

  • Lance Edmonds
    replied
    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> )

    Leave a comment:


  • Scott Turchin
    replied
    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   [img]http://www.powerbasic.com/support/forums/smile.gif[/img]
             Control Set Text hDlg, hStatus, Mine + " " + Ver + " " + Copyrite
    -------------
    Scott Turchin




    [This message has been edited by Scott Turchin (edited January 10, 2000).]

    Leave a comment:


  • Scott Turchin
    replied
    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


    Leave a comment:


  • Peter Lameijn
    started a topic Control Add

    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.
Working...
X