WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Boxes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Resize Dialog UDFs

 Keywords: Resize Dialog Dynamically Size GetStyle SetStyle Get_Control_Movement Set_Control_Movement Move_Sub

;Dialog Resize/Move example with native Resizing.  Requires a WB 2010B version or higher and uses the 6.2 version of dialogs.
;Jim Taylor (jtaylor@jtdata.com)

Home_Path = DirScript()
DirChange(Home_Path)
GoSub Load_Routines
IntControl(49,3,0,0,0)
WinHide("")
Init_Dialog_Constants()

;Call("move_controls.wdl","")

;Exit


MoveFormat=`WWWDLGED,6.2`

MoveCaption=`Button_Move`
MoveX=002
MoveY=038
MoveWidth=372
MoveHeight=278
MoveMinWidth=200
MoveMinHeight=175
MoveNumControls=010
MoveProcedure=`Move_Sub`
MoveFont=`DEFAULT`
MoveTextColor=`DEFAULT`
MoveBackground=`DEFAULT,0|0|0`
MoveConfig=0

Move001=`291,003,036,012,PUSHBUTTON,"pb_go",DEFAULT,"Go",1,1,32,DEFAULT,DEFAULT,DEFAULT`
Move002=`331,003,036,012,PUSHBUTTON,"pb_exit",DEFAULT,"E&xit",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Move003=`003,005,018,012,STATICTEXT,"st_url",DEFAULT,"URL:",DEFAULT,30,DEFAULT,"Microsoft Sans Serif|6144|70|34","255|255|255",DEFAULT`
Move004=`023,003,266,012,EDITBOX,"eb_url",url,"url",DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Move005=`003,019,364,060,COMCONTROL,"cc_browser",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move006=`003,081,178,060,COMCONTROL,"cc_browser2",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move007=`189,081,178,060,COMCONTROL,"cc_browser3",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move008=`003,145,178,060,COMCONTROL,"cc_browser4",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move009=`189,145,178,060,COMCONTROL,"cc_browser5",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move010=`097,209,178,060,COMCONTROL,"cc_browser6",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`

ButtonPushed=Dialog("Move")


Exit


:Load_Routines


#DefineSubRoutine Get_Control_Movement(Mov_Handle, Win_Name, win_track)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;The following is the initial sizes, enumeration and settings
  ;for how a control will be handled during a resize. Obviously,
  ;it would be nice if this information was contained, and handled,
  ;by the Dialog.  You can GROW and MOVE the same control. You
  ;must define what percentage of the change the control will receive,
  ;both vertically and horizontally.

  ;If you have stacked controls then keep in mind that the
  ;percentage of the move/grow changes as you move down/across.
  ;That is, if you have four controls, the first one might stay
  ;where it is for the move (value of 1) but have .25 for the grow,
  ;the second will receive .25 for the move and .25 for the grow,
  ;the third will have .5 for the move and .25 for the grow
  ;the fourth will have .75 for the move and .25 for the grow.

  ;If you have very many controls you may find this easier to maintain
  ;in an external file and use ArrayFileGetCSV().  The following format
  ;will work.  The header row is important as it fills the first row
  ;thereby allowing the use of a one-based array.
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  Decimals(-1)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;This retrieves the original size/position of the Dialog and each control
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  init_xsize           = ItemExtract(1,DialogProcOptions(Move_Handle, dpo_getclientarea,-1)," ")
  init_ysize           = ItemExtract(2,DialogProcOptions(Move_Handle, dpo_getclientarea,-1)," ")

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;This is the move/grow definition for each control
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  arr_txt = ""
  arr_txt = arr_txt:"name,           movement,                      x_m,  x_g,  y_m,  y_g":@CR

  If win_track == "Move" Then

    arr_txt = arr_txt:"pb_go,        POS_MOVE_H,                      1,    1,    1,    1":@CR
    arr_txt = arr_txt:"pb_exit,      POS_MOVE_H,                      1,    1,    1,    1":@CR
    arr_txt = arr_txt:"st_url,       POS_FIX,                         1,    1,    1,    1":@CR
    arr_txt = arr_txt:"eb_url,       POS_GROW_H,                      1,    1,    1,    1":@CR
    arr_txt = arr_txt:"cc_browser,   POS_GROW_H|POS_GROW_V,           1,    1,  .25,  .25":@CR
    arr_txt = arr_txt:"cc_browser2,  POS_GROW_H|POS_GROWMOVE_V,      .5,   .5,  .25,  .25":@CR
    arr_txt = arr_txt:"cc_browser3,  POS_GROWMOVE_H|POS_GROWMOVE_V,  .5,   .5,  .25,  .25":@CR
    arr_txt = arr_txt:"cc_browser4,  POS_GROW_H|POS_GROWMOVE_V,      .5,   .5,   .5,  .25":@CR
    arr_txt = arr_txt:"cc_browser5,  POS_GROWMOVE_H|POS_GROWMOVE_V,  .5,   .5,   .5,  .25":@CR
    arr_txt = arr_txt:"cc_browser6,  POS_MOVE_H|POS_GROWMOVE_V,      .5,    1,  .75,  .25"

  EndIf

  arr_txt = StrReplace(arr_txt," ","")
  o_array%win_track% = Arrayize(arr_txt,@CR)
  ArrayRedim(o_array%win_track%,-1,7)
  xcnt = ArrInfo(o_array%win_track%,1)-1
  For x = 0 To xcnt
     txt = o_array%win_track%[x,0]
     o_array%win_track%[x,5] = ItemExtract(6,txt,",")
     o_array%win_track%[x,4] = ItemExtract(5,txt,",")
     o_array%win_track%[x,3] = ItemExtract(4,txt,",")
     o_array%win_track%[x,2] = ItemExtract(3,txt,",")
     o_array%win_track%[x,1] = ItemExtract(2,txt,",")
     o_array%win_track%[x,0] = ItemExtract(1,txt,",")
     If x > 0 Then o_array%win_track%[x,6] = DialogControlGet(Mov_Handle,o_array%win_track%[x,0],dc_position)
  Next

#EndSubRoutine


#DefineFunction Set_Control_Movement(Mov_Handle,xy,xdiff,ydiff,xt,yt,xb,yb,o_array)


  POS_FIX             =  0 ; Fixed Position with No Growth
  POS_GROW_H          =  1 ; Fixed Position but grow Horizontally
  POS_GROW_V          =  2 ; Fixed Position but grow Vertically
  POS_MOVE_H          =  4 ; Move Horizontally with Resize but no growth
  POS_MOVE_V          =  8 ; Move Vertically with Resize but no growth
  POS_GROWMOVE_H      = 16 ; Grow and Move Horizontally
  POS_GROWMOVE_V      = 32 ; Grow and Move Vertically

  dc_position = 17
  Decimals(-1)
  tvar     = o_array[xy,0]
  move_var = o_array[xy,1]
  ocutx_m  = o_array[xy,2]
  ocutx_g  = o_array[xy,3]
  ocuty_m  = o_array[xy,4]
  ocuty_g  = o_array[xy,5]

  xt_m_adj = 0
  yt_m_adj = 0
  xb_g_adj = 0
  yb_g_adj = 0

  If xt+(xdiff*%ocutx_m%) < 0 Then xt_m_adj = (xt+(xdiff*%ocutx_m%))*-1
  If yt+(ydiff*%ocuty_m%) < 0 Then yt_m_adj = (yt+(ydiff*%ocuty_m%))*-1
  If xb+(xdiff*%ocutx_g%) < 0 Then xb_g_adj = (xb+(xdiff*%ocutx_g%))*-1
  If yb+(ydiff*%ocuty_g%) < 0 Then yb_g_adj = (yb+(ydiff*%ocuty_g%))*-1

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  Decimals(0)

  If %move_var% & POS_FIX Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb:" ":yb)
    Return
  EndIf
  If %move_var% & POS_MOVE_H && %move_var% & POS_GROWMOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_MOVE_H && %move_var% & POS_GROW_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_MOVE_V && %move_var% & POS_GROW_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
    Return
  EndIf
  If %move_var% & POS_MOVE_V && %move_var% & POS_GROWMOVE_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
    Return
  EndIf
  If %move_var% & POS_GROW_H && %move_var% & POS_GROWMOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%):" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_GROW_V && %move_var% & POS_GROWMOVE_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_MOVE_H && %move_var% & POS_MOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb)
    Return
  EndIf
  If %move_var% & POS_MOVE_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb:" ":yb)
    Return
  EndIf
  If %move_var% & POS_MOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb)
    Return
  EndIf
  If %move_var% & POS_GROW_H && %move_var% & POS_GROW_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_GROW_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
    Return
  EndIf
  If %move_var% & POS_GROW_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_GROWMOVE_H && %move_var% & POS_GROWMOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf
  If %move_var% & POS_GROWMOVE_H Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
    Return
  EndIf
  If %move_var% & POS_GROWMOVE_V Then
    DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
    Return
  EndIf

#EndFunction

#DefineSubRoutine Resize_it(Mov_Handle, Win_Name)

    Decimals(-1)
    xdiff   = curr_xsize - init_xsize
    ydiff   = curr_ysize - init_ysize

   ;test_text = ""
    resized_it = 1
    xcnt = ArrInfo(o_array%win_track%,1)-1
    For xy = 1 To xcnt
      xt = ItemExtract(1,o_array%win_track%[xy,6]," ")
      yt = ItemExtract(2,o_array%win_track%[xy,6]," ")
      xb = ItemExtract(3,o_array%win_track%[xy,6]," ")
      yb = ItemExtract(4,o_array%win_track%[xy,6]," ")
      Decimals(0)
      Set_Control_Movement(Mov_Handle,xy,xdiff,ydiff,xt,yt,xb,yb,o_array%win_track%)
      Decimals(-1)
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;Refresh the Control as it doesn't always redraw correctly.
      DialogControlSet(Mov_Handle,DialogProcOptions(Mov_Handle,1004,xy),11,DialogControlGet(Mov_Handle,DialogProcOptions(Mov_Handle,1004,xy),11))
    Next

#EndSubRoutine

#DefineSubRoutine Move_Sub(Move_Handle,DMsg,DCID,resvd4,resvd5)

Switch (DMsg)
    Case msg_init                 ; Dialog Initialization
    DialogProcOptions(Move_Handle, msg_timer,400)                          ; TimerEvent (0- Off).
    DialogProcOptions(Move_Handle, msg_closevia49,1)                       ; Close selected (IntControl(49....) (1-On, 0-Off).
    DialogProcOptions(Move_Handle, dpo_disablestate,0)                     ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
    DialogProcOptions(Move_Handle, dpo_changebackground,-1)                ; Change Dialog Background (Bitmap File or RGB String).
    DialogProcOptions(Move_Handle, msg_buttonpushed,1)                     ; PushButton/PictureButton.
    DialogProcOptions(Move_Handle, msg_editbox,1)                          ; EditBox or Multi-LineBox.
    DialogProcOptions(Move_Handle, msg_resize,1)                           ; Resize

    url      = "http://www.jtdata.com/wb_rad.html"
    obrowser = DialogObject(Move_Handle,"cc_browser",dlgobject_getobject)
    obrowser.navigate(url,0,"","","")
    url      = "http://www.google.com"

    obrowse2 = DialogObject(Move_Handle,"cc_browser2",dlgobject_getobject)
    obrowse2.navigate(url,0,"","","")

    obrowse3 = DialogObject(Move_Handle,"cc_browser3",dlgobject_getobject)
    obrowse3.navigate(url,0,"","","")

    obrowse4 = DialogObject(Move_Handle,"cc_browser4",dlgobject_getobject)
    obrowse4.navigate(url,0,"","","")

    obrowse5 = DialogObject(Move_Handle,"cc_browser5",dlgobject_getobject)
    obrowse5.navigate(url,0,"","","")

    obrowse6 = DialogObject(Move_Handle,"cc_browser6",dlgobject_getobject)
    obrowse6.navigate(url,0,"","","")

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    win_track = "Move"                            ;Dialog Variable.  Used to retrieve additional dialog info.
                                                  ;This also allows you to resize sub-dialogs using the same code.
                                                  ;You only need to change this in the sub-dialog callback
                                                  ;and defined the movement in the Get_Control_Movement function.
                                                  ;Be sure you reset win_track for the calling dialog
                                                  ;upon return.
                                                  ;*************The only other change is in Get_Control_Movement()
                                                  ;             There is an 'If' statement for the Move/Grow definitions
                                                  ;*************
    Win_Name%win_track% = %win_track%Caption      ;Name of Dialog as contained in the Title Bar.

    Get_Control_Movement(Move_Handle, Win_Name%win_track%, win_track)

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Break

  Case msg_resize
    curr_xsize  = ItemExtract(1,DialogProcOptions(Move_Handle, dpo_getclientarea,-1)," ")
    curr_ysize  = ItemExtract(2,DialogProcOptions(Move_Handle, dpo_getclientarea,-1)," ")
    Resize_It(Move_Handle,"Button_Move")
    Break
  Case msg_timer                ; TimerEvent
    If obrowser.LocationURL != url Then
      DialogControlSet(Move_Handle,"eb_url",dc_editbox,obrowser.LocationURL)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
      DialogProcOptions(Move_Handle, msg_timer,400)
    EndIf
    Break
  Case msg_closevia49           ; Close
    Return 9
    Break
  Case msg_editbox              ; Edit/MultiLine Box
    If DCID == "eb_url" Then
      DialogProcOptions(Move_Handle, msg_timer,2000)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
    EndIf
  Case msg_buttonpushed         ; PushButtion
    If DCID == "pb_go" Then
      nSelection = DialogControlGet(Move_Handle,"pb_Go",dc_title)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
      If StrTrim(url) != "" Then obrowser.navigate(url,0,"","","")
      DialogControlSet(Move_Handle,"eb_url",dc_editbox,obrowser.LocationURL)
    EndIf
    If DCID == "pb_exit" Then
      nSelection = DialogControlGet(Move_Handle,"pb_Exit",dc_title)
      Return -1
    EndIf
    Break
EndSwitch
Return -2

#EndSubRoutine


#DefineSubRoutine Init_Dialog_Constants()

   ;DialogprocOptions Constants

   MSG_INIT               = 0    ; The one-time initilization
   MSG_TIMER              = 1    ; Timer event
   MSG_BUTTONPUSHED       = 2    ; Pushbutton or Picturebutton
   MSG_RADIOPUSHED        = 3    ; Radiobutton clicked
   MSG_CHECKBOX           = 4    ; Checkbox clicked
   MSG_EDITBOX            = 5    ; Editbox or Multilinebox
   MSG_FILESELECT         = 6    ; Filelistbox
   MSG_ITEMSELECT         = 7    ; Itembox
   MSG_COMBOCHANGE        = 8    ; Combobox/Droplistbox
   MSG_CALENDAR           = 9    ; Calendar date change
   MSG_SPINNER            = 10   ; Spinner number change
   MSG_CLOSEVIA49         = 11   ; Close clicked (Enabled via Intcontrol 49)
   MSG_FILEBOXDOUBLECLICK = 12   ; Get double-click message on a FileListBox
   MSG_ITEMBOXDOUBLECLICK = 13   ; Get double-click message on an ItemBox
   MSG_COMEVENT           = 14   ; Get double-click message on an ItemBox
   MSG_MENUITEM           = 15   ; MenuItem selected
   MSG_MENUITEMINIT       = 16   ; MenuItem initialized
   MSG_RESIZE             = 17   ; Dialog resized

   DPO_DISABLESTATE       = 1000 ; codes -1=GetSetting 0=EnableDialog 1=DisableDialog
   DPO_CHANGEBACKGROUND   = 1001 ; -1=GetSetting otherise bitmap or color string
   DPO_CHANGESYSMENU      = 1002 ; -1=Get Current 0=none 1=close 2=close/min 3=close/max 4=close/min/max
   DPO_CHANGETITLE        = 1003 ; -1=Get Current otherise new title
   DPO_GETNAME            = 1004 ; Returns the name associated with a control's number.
   DPO_GETNUMBER          = 1005 ; Returns the number associated with a control's name.
   DPO_GETCLIENTAREA      = 1007 ; Returns a space delimited list of the width and height of the client area.


   ;DialogControlState Constants
   DCSTATE_SETFOCUS       = 1    ; Give Control Focus
   DCSTATE_QUERYSTYLE     = 2    ; Query control's style
   DCSTATE_ADDSTYLE       = 3    ; Add control style
   DCSTATE_REMOVESTYLE    = 4    ; Remove control style
   DCSTATE_GETFOCUS       = 5    ; Get control that has focus
   DCSTYLE_INVISIBLE      = 1    ; Set Control Invisible
   DCSTYLE_DISABLED       = 2    ; Set Control Disabled
   DCSTYLE_NOUSERDATA     = 4    ; Note: Setable via DialogControlState function ONLY SPINNER control only
   DCSTYLE_READONLY       = 8    ; Sets control to read-only (user cannot type in data) EDITBOX MULTILINEBOX SPINNER
   DCSTYLE_PASSWORD       = 16   ; Sets 'password mode' where only *'s are displayed EDITBOX
   DCSTYLE_DEFAULTBUTTON  = 32   ; Sets a button as a the default button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_DIGITSONLY     = 64   ; Set edit box to accept digits only EDITMOX MULTILINEBOX
   DCSTYLE_FLAT           = 128  ; Makes a 'flat' hyperlink-looking button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_HEIGHT         = 256  ; Turns off automatic height adjustment on ItemBoxes and FileListBoxes
   DCSTYLE_CENTER         = 512  ; Center Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_RIGHT          = 1024 ; Right Justify Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_NOSELCURLEFT   = 2048 ; No selection, cursor left EDITBOX MULTILINEBOX
   DCSTYLE_NOSELCURRIGHT  = 4096 ; No selection, cursor right EDITBOX MULTILINEBOX

   ;DialogControlSet / DialogControlGet Constants
   DC_CHECKBOX            = 1    ; CHECKBOX
   DC_RADIOBUTTON         = 2    ; RADIOBUTTON
   DC_EDITBOX             = 3    ; EDITBOX MULTILINEBOX
   DC_TITLE               = 4    ; PICTURE RADIOBUTTON CHECKBOX PICTUREBUTTON VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON
   DC_ITEMBOXCONTENTS     = 5    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXSELECT       = 6    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_CALENDAR            = 7    ; CALENDAR
   DC_SPINNER             = 8    ; SPINNER
   DC_MULTITABSTOPS       = 9    ; MULTILINEBOX
   DC_ITEMSCROLLPOS       = 10   ; ITEMBOX FILELISTBOX
   DC_BACKGROUNDCOLOR     = 11   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FILELISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_PICTUREBITMAP       = 12   ; PICTURE PICTUREBUTTON
   DC_TEXTCOLOR           = 13   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FIELLISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_ITEMBOXADD          = 14   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXREMOVE       = 15   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_RADIOCONTROL        = 16   ; RADIOBUTTON
   DC_POSITION            = 17   ; ALL CONTROLS

   ;DialogObject constants

   DLGOBJECT_ADDEVENT     = 1    ; Call dialog callback when the specified event occurs
   DLGOBJECT_REMOVEEVENT  = 2    ; Stop calling dialog callback when an event previously requested with
   DLGOBJECT_GETOBJECT    = 3    ; Return an object references to the specified control
   DLGOBJECT_GETPICOBJECT = 4    ; Create and return an object reference to a picture object

   ;Return code constants
   RET_DO_CANCEL          =  0   ; Cancels dialog
   RET_DO_DEFAULT         = -1   ; Continue with default processing for control
   RET_DO_NOT_EXIT        = -2   ; Do not exit the dialog

#EndSubRoutine

Return


Older code sample using DllCall

;Dialog Resize/Move example.  Requires a WB 2009 version or higher (2008E might work).  It uses the 6.2 version of dialogs.
;You can set a limit of how small you want to shrink/move controls.  This is currently set at 50%. The Dialog doesn't have a limit.
;Thanks to Guido or whoever provided the GetStyle/SetStyle functions.
;Jim Taylor (jtaylor@jtdata.com)



Home_Path = DirScript()
DirChange(Home_Path)
GoSub Load_Routines
IntControl(49,3,0,0,0)
WinHide("")
Init_Dialog_Constants()

;Call("move_controls.wdl","")

;Exit

MoveFormat=`WWWDLGED,6.2`

MoveCaption=`Button_Move`
MoveX=002
MoveY=038
MoveWidth=372
MoveHeight=278
MoveNumControls=010
MoveProcedure=`Move_Sub`
MoveFont=`DEFAULT`
MoveTextColor=`DEFAULT`
MoveBackground=`DEFAULT,0|0|0`
MoveConfig=0

Move001=`291,003,036,012,PUSHBUTTON,"pb_go",DEFAULT,"Go",1,1,32,DEFAULT,DEFAULT,DEFAULT`
Move002=`331,003,036,012,PUSHBUTTON,"pb_exit",DEFAULT,"E&xit",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Move003=`003,005,018,012,STATICTEXT,"st_url",DEFAULT,"URL:",DEFAULT,30,DEFAULT,"Microsoft Sans Serif|6144|70|34","255|255|255",DEFAULT`
Move004=`023,003,266,012,EDITBOX,"eb_url",url,"url",DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Move005=`003,019,364,060,COMCONTROL,"cc_browser",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move006=`003,081,178,060,COMCONTROL,"cc_browser2",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move007=`189,081,178,060,COMCONTROL,"cc_browser3",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move008=`003,145,178,060,COMCONTROL,"cc_browser4",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move009=`189,145,178,060,COMCONTROL,"cc_browser5",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`
Move010=`097,209,178,060,COMCONTROL,"cc_browser6",DEFAULT,"Shell.Explorer.1",DEFAULT,50,DEFAULT,DEFAULT,DEFAULT,"128|128|128"`

ButtonPushed=Dialog("Move")


Exit


:Load_Routines


;; Returns a window's styles
;;;;;;;;;;;;;;;;;;;;;;;;;;;
#DefineFunction GetStyle(hWnd)
  user32 = StrCat(DirWindows(1),"user32.dll")
  GWL_STYLE = -16 ; offset for the Window Style value
  ret = DllCall(user32,long:"GetWindowLongA",long:hWnd,long:GWL_STYLE)
  Return ret
#EndFunction

;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Sets a window's styles
;;;;;;;;;;;;;;;;;;;;;;;;;;;
#DefineFunction SetStyle(hWnd, nstyle)
  user32 = StrCat(DirWindows(1),"user32.dll")
  GWL_STYLE = -16 ; offset for the Window Style value
  ret = DllCall(user32,long:"SetWindowLongA",long:hWnd,long:GWL_STYLE,long:nstyle)
  Return ret
#EndFunction

#DefineSubRoutine Get_Control_Movement(Mov_Handle, Win_Name, win_track)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;The following is the initial sizes, enumeration and settings
  ;for how a control will be handled during a resize. Obviously,
  ;it would be nice if this information was contained, and handled,
  ;by the Dialog.  You can GROW and MOVE the same control. You
  ;must define what percentage of the change the control will receive,
  ;both vertically and horizontally.

  ;If you have stacked controls then keep in mind that the
  ;percentage of the move/grow changes as you move down/across.
  ;That is, if you have four controls, the first one might stay
  ;where it is for the move (value of 1) but have .25 for the grow,
  ;the second will receive .25 for the move and .25 for the grow,
  ;the third will have .5 for the move and .25 for the grow
  ;the fourth will have .75 for the move and .25 for the grow.

  ;If you have very many controls you may find this easier to maintain
  ;in an external file and use ArrayFileGetCSV().  The following format
  ;will work.  The header row is important as it fills the first row
  ;thereby allowing one to use a one-based array.
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  ; Add a "sizable" border.
  WS_THICKFRAME = 262144   ; Style adds sizing border.
  nStyle = GetStyle(Mov_Handle)
  nStyle = nStyle | WS_THICKFRAME
  SetStyle(Mov_Handle,nStyle)

  Decimals(-1)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;This retrieves the screen and dialog sizes
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ppuh    = WinMetrics(-5)
  ppuv    = WinMetrics(-6)
  lpuh    = WinMetrics(0)/1000.0 ;Determine logical screen width  in pixel units
  lpuv    = WinMetrics(1)/1000.0 ;Determine logical screen height in pixel units

  wpos    = WinPosition(Win_Name)
  dwidth  = ItemExtract(3,wpos,",")-ItemExtract(1,wpos,",")
  dheight = ItemExtract(4,wpos,",")-ItemExtract(2,wpos,",")
  dwidth  = (dwidth*lpuh)/ppuh
  dheight = (dheight*lpuv)/ppuv
  x_save%win_track%  = dwidth
  y_save%win_track%  = dheight
  x_min%win_track%   = dwidth
  y_min%win_track%   = dheight

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;This retrieves the original size/position of each control
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  o_size%win_track%  = ArrDimension(num_ctrl%win_track%+1)
  For xy = 1 To num_ctrl%win_track%  ;Gets Original Position
    o_size%win_track%[xy] = DialogControlGet(Mov_Handle,DialogProcOptions(Mov_Handle,1004,xy),dc_position)
  Next

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;This is the move/grow definition for each control
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  arr_txt = ""
  arr_txt = arr_txt:"name,           movement,                      x_m,  x_g,  y_m,  y_g":@CRLF

  If win_track == "MOV" Then

    arr_txt = arr_txt:"pb_go,        POS_MOVE_H,                      1,    1,    1,    1":@CRLF
    arr_txt = arr_txt:"pb_exit,      POS_MOVE_H,                      1,    1,    1,    1":@CRLF
    arr_txt = arr_txt:"st_url,       POS_FIX,                         1,    1,    1,    1":@CRLF
    arr_txt = arr_txt:"eb_url,       POS_GROW_H,                      1,    1,    1,    1":@CRLF
    arr_txt = arr_txt:"cc_browser,   POS_GROW_H|POS_GROW_V,           1,    1,  .25,  .25":@CRLF
    arr_txt = arr_txt:"cc_browser2,  POS_GROW_H|POS_GROWMOVE_V,      .5,   .5,  .25,  .25":@CRLF
    arr_txt = arr_txt:"cc_browser3,  POS_GROWMOVE_H|POS_GROWMOVE_V,  .5,   .5,  .25,  .25":@CRLF
    arr_txt = arr_txt:"cc_browser4,  POS_GROW_H|POS_GROWMOVE_V,      .5,   .5,   .5,  .25":@CRLF
    arr_txt = arr_txt:"cc_browser5,  POS_GROWMOVE_H|POS_GROWMOVE_V,  .5,   .5,   .5,  .25":@CRLF
    arr_txt = arr_txt:"cc_browser6,  POS_MOVE_H|POS_GROWMOVE_V,      .5,    1,  .75,  .25"

  EndIf

  arr_txt = StrReplace(arr_txt," ","")
  arr_file = DirScript():"resize_temp.csv"
  FilePut(arr_file,arr_txt)

  o_array%win_track% = ArrayFileGetCSV(arr_file,0)
  TimeDelay(.01)  ; Odd problem where the data is not initialized in the array without this delay.


#EndSubRoutine


#DefineFunction Set_Control_Movement(Mov_Handle,xy,xdiff,ydiff,xt,yt,xb,yb,o_array)


  POS_FIX             =  0 ; Allow Move/Resize of Control
  POS_GROW_H          =  1 ; Fixed Position but grow Horizontally
  POS_GROW_V          =  2 ; Fixed Position but grow Vertically
  POS_MOVE_H          =  4 ; Move Horizontally with Resize but no growth
  POS_MOVE_V          =  8 ; Move Vertically with Resize but no growth
  POS_GROWMOVE_H      = 16 ; Grow and Move Horizontally
  POS_GROWMOVE_V      = 32 ; Grow and Move Vertically

    dc_position = 17
    Decimals(-1)
    tvar     = o_array[xy,0]
    move_var = o_array[xy,1]
    ocutx_m  = o_array[xy,2]
    ocutx_g  = o_array[xy,3]
    ocuty_m  = o_array[xy,4]
    ocuty_g  = o_array[xy,5]

    xt_m_adj = 0
    yt_m_adj = 0
    xb_g_adj = 0
    yb_g_adj = 0

    If xt+(xdiff*%ocutx_m%) < 0 Then xt_m_adj = (xt+(xdiff*%ocutx_m%))*-1
    If yt+(ydiff*%ocuty_m%) < 0 Then yt_m_adj = (yt+(ydiff*%ocuty_m%))*-1
    If xb+(xdiff*%ocutx_g%) < 0 Then xb_g_adj = (xb+(xdiff*%ocutx_g%))*-1
    If yb+(ydiff*%ocuty_g%) < 0 Then yb_g_adj = (yb+(ydiff*%ocuty_g%))*-1

;   xt_chk = xt+(xdiff*%ocutx_m%)
;   yt_chk = yt+(ydiff*%ocuty_m%)
;   xb_chk = xb+(xdiff*%ocutx_g%)
;   yb_chk = yb+(ydiff*%ocuty_g%)

;   test_text = test_text:@CRLF:@CRLF:tvar:@CRLF:xt_chk:" / ":yt_chk:" / ":xb_chk:" / ":yb_chk:@CRLF:xt:" / ":yt:" / ":xb:" / ":yb:@CRLF:xdiff:" / ":ydiff:@CRLF:%ocutx_m%:" / ":%ocuty_m%:" / ":%ocutx_g%:" / ":%ocuty_g%
;   clipput(test_text)

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Decimals(0)

    If %move_var% & POS_FIX Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb:" ":yb)
      Return
    EndIf
    If %move_var% & POS_MOVE_H && %move_var% & POS_GROWMOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_MOVE_H && %move_var% & POS_GROW_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_MOVE_V && %move_var% & POS_GROW_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
      Return
    EndIf
    If %move_var% & POS_MOVE_V && %move_var% & POS_GROWMOVE_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
      Return
    EndIf
    If %move_var% & POS_GROW_H && %move_var% & POS_GROWMOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%):" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_GROW_V && %move_var% & POS_GROWMOVE_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_MOVE_H && %move_var% & POS_MOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb)
      Return
    EndIf
    If %move_var% & POS_MOVE_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb:" ":yb)
      Return
    EndIf
    If %move_var% & POS_MOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb)
      Return
    EndIf
    If %move_var% & POS_GROW_H && %move_var% & POS_GROW_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_GROW_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
      Return
    EndIf
    If %move_var% & POS_GROW_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_GROWMOVE_H && %move_var% & POS_GROWMOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf
    If %move_var% & POS_GROWMOVE_H Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt+(xdiff*%ocutx_m%)+xt_m_adj:" ":yt:" ":xb+(xdiff*%ocutx_g%)+xb_g_adj:" ":yb)
      Return
    EndIf
    If %move_var% & POS_GROWMOVE_V Then
      DialogControlSet(Mov_Handle,tvar,dc_position,xt:" ":yt+(ydiff*%ocuty_m%)+yt_m_adj:" ":xb:" ":yb+(ydiff*%ocuty_g%)+yb_g_adj)
      Return
    EndIf

#EndFunction

#DefineSubRoutine Resize_it(Mov_Handle, Win_Name)

    Decimals(-1)
    wpos    = WinPosition(Win_Name)
    dwidth  = ItemExtract(3,wpos,",")-ItemExtract(1,wpos,",")
    dheight = ItemExtract(4,wpos,",")-ItemExtract(2,wpos,",")
    dwidth  = (dwidth*lpuh)/ppuh
    dheight = (dheight*lpuv)/ppuv
    xdiff   = dwidth  - x_min%win_track%
    ydiff   = dheight - y_min%win_track%

    If dwidth  < x_min%win_track% && dwidth  < x_min%win_track%*slimit%win_track% Then xdiff = (x_min%win_track%-(x_min%win_track%*slimit%win_track%))*-1
    If dheight < y_min%win_track% && dheight < y_min%win_track%*slimit%win_track% Then ydiff = (y_min%win_track%-(y_min%win_track%*slimit%win_track%))*-1

    If slimit%win_track% >= 1 Then
      If dwidth  < x_min%win_track% Then xdiff = 0
      If dheight < y_min%win_track% Then ydiff = 0
    EndIf


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;Moving the dialog on the screen will often result in the size changing by one unit so
    ;I account for that here and do not resize if the change is only one unit.
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    If (x_save%win_track% != dwidth && (x_save%win_track% < dwidth-1 || x_save%win_track% > dwidth+1)) || (y_save%win_track% != dheight && (y_save%win_track% < dheight-1 || y_save%win_track% > dheight+1)) Then
     ;test_text = ""
      For xy = 1 To num_ctrl%win_track%
        DialogProcOptions(Mov_Handle, msg_timer,400)                          ; TimerEvent (0- Off).
        xt = ItemExtract(1,o_size%win_track%[xy]," ")
        yt = ItemExtract(2,o_size%win_track%[xy]," ")
        xb = ItemExtract(3,o_size%win_track%[xy]," ")
        yb = ItemExtract(4,o_size%win_track%[xy]," ")
        Decimals(0)
        Set_Control_Movement(Mov_Handle,xy,xdiff,ydiff,xt,yt,xb,yb,o_array%win_track%)
        Decimals(-1)
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;Refresh the Control as it doesn't always redraw correctly.
        tvar = o_array%win_track%[xy,0]
        DialogControlSet(Mov_Handle,tvar,11,DialogControlGet(Mov_Handle,tvar,11))
      Next
      x_save%win_track% = dwidth
      y_save%win_track% = dheight
    EndIf

#EndSubRoutine

#DefineSubRoutine Move_Sub(Move_Handle,DMsg,DCID,resvd4,resvd5)

Switch (DMsg)
    Case msg_init                 ; Dialog Initialization
    DialogProcOptions(Move_Handle, msg_timer,400)                          ; TimerEvent (0- Off).
    DialogProcOptions(Move_Handle, msg_closevia49,1)                       ; Close selected (IntControl(49....) (1-On, 0-Off).
    DialogProcOptions(Move_Handle, dpo_disablestate,0)                     ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
    DialogProcOptions(Move_Handle, dpo_changebackground,-1)                ; Change Dialog Background (Bitmap File or RGB String).
    DialogProcOptions(Move_Handle, msg_buttonpushed,1)                     ; PushButton/PictureButton.
    DialogProcOptions(Move_Handle, msg_editbox,1)                          ; EditBox or Multi-LineBox.

    url      = "http://www.jtdata.com"
    obrowser = DialogObject(Move_Handle,"cc_browser",dlgobject_getobject)
    obrowser.navigate("About:Blank",0,'','','')
    obrowser.navigate(url,0,"","","")

    obrowse2 = DialogObject(Move_Handle,"cc_browser2",dlgobject_getobject)
    obrowse2.navigate("About:Blank",0,'','','')
    obrowse2.navigate(url,0,"","","")

    obrowse3 = DialogObject(Move_Handle,"cc_browser3",dlgobject_getobject)
    obrowse3.navigate("About:Blank",0,'','','')
    obrowse3.navigate(url,0,"","","")

    obrowse4 = DialogObject(Move_Handle,"cc_browser4",dlgobject_getobject)
    obrowse4.navigate("About:Blank",0,'','','')
    obrowse4.navigate(url,0,"","","")

    obrowse5 = DialogObject(Move_Handle,"cc_browser5",dlgobject_getobject)
    obrowse5.navigate("About:Blank",0,'','','')
    obrowse5.navigate(url,0,"","","")

    obrowse6 = DialogObject(Move_Handle,"cc_browser6",dlgobject_getobject)
    obrowse6.navigate("About:Blank",0,'','','')
    obrowse6.navigate(url,0,"","","")

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    win_track = "MOV"                     ;This allows you to resize sub-dialogs using the same code.
                                          ;You only need to change this in the sub-dialog callback
                                          ;and defined the movement in the Get_Control_Movement function.
                                          ;Be sure you reset win_track for the calling dialog
                                          ;upon return.

    slimit%win_track%    = .50            ;This variable keeps it from shrinking past a
                                          ;certain percentage of the original size.
                                          ;Set to 1 to limit shrinkage to original size.
    num_ctrl%win_track%  = 10             ;Number of Controls contained within the dialog
    Win_Name%win_track%  = "Button_Move"  ;Name of Dialog as contained in the Title Bar.

    Get_Control_Movement(Move_Handle, Win_Name%win_track%, win_track)

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Break

  Case msg_timer                ; TimerEvent

    Resize_It(Move_Handle,"Button_Move")

    If obrowser.LocationURL != url Then
      DialogControlSet(Move_Handle,"eb_url",dc_editbox,obrowser.LocationURL)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
      DialogProcOptions(Move_Handle, msg_timer,400)
    EndIf
    Break
  Case msg_closevia49           ; Close
    Return 9
    Break
  Case msg_editbox              ; Edit/MultiLine Box
    If DCID == "eb_url" Then
      DialogProcOptions(Move_Handle, msg_timer,2000)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
    EndIf
  Case msg_buttonpushed         ; PushButtion
    If DCID == "pb_go" Then
      nSelection = DialogControlGet(Move_Handle,"pb_Go",dc_title)
      url = DialogControlGet(Move_Handle,"eb_url",dc_editbox)
      If StrTrim(url) != "" Then obrowser.navigate(url,0,"","","")
      DialogControlSet(Move_Handle,"eb_url",dc_editbox,obrowser.LocationURL)
    EndIf
    If DCID == "pb_exit" Then
      nSelection = DialogControlGet(Move_Handle,"pb_Exit",dc_title)
      Return -1
    EndIf
    Break
EndSwitch
Return -2

#EndSubRoutine


#DefineSubRoutine Init_Dialog_Constants()

   ;DialogprocOptions Constants

   MSG_INIT               = 0    ; The one-time initilization
   MSG_TIMER              = 1    ; Timer event
   MSG_BUTTONPUSHED       = 2    ; Pushbutton or Picturebutton
   MSG_RADIOPUSHED        = 3    ; Radiobutton clicked
   MSG_CHECKBOX           = 4    ; Checkbox clicked
   MSG_EDITBOX            = 5    ; Editbox or Multilinebox
   MSG_FILESELECT         = 6    ; Filelistbox
   MSG_ITEMSELECT         = 7    ; Itembox
   MSG_COMBOCHANGE        = 8    ; Combobox/Droplistbox
   MSG_CALENDAR           = 9    ; Calendar date change
   MSG_SPINNER            = 10   ; Spinner number change
   MSG_CLOSEVIA49         = 11   ; Close clicked (Enabled via Intcontrol 49)
   MSG_FILEBOXDOUBLECLICK = 12   ; Get double-click message on a FileListBox
   MSG_ITEMBOXDOUBLECLICK = 13   ; Get double-click message on an ItemBox
   MSG_COMEVENT           = 14   ; Get double-click message on an ItemBox

   DPO_DISABLESTATE       = 1000 ; codes -1=GetSetting 0=EnableDialog 1=DisableDialog
   DPO_CHANGEBACKGROUND   = 1001 ; -1=GetSetting otherise bitmap or color string
   DPO_CHANGESYSMENU      = 1002 ; -1=Get Current 0=none 1=close 2=close/min 3=close/max 4=close/min/max
   DPO_CHANGETITLE        = 1003 ; -1=Get Current otherise new title

   ;DialogControlState Constants
   DCSTATE_SETFOCUS       = 1    ; Give Control Focus
   DCSTATE_QUERYSTYLE     = 2    ; Query control's style
   DCSTATE_ADDSTYLE       = 3    ; Add control style
   DCSTATE_REMOVESTYLE    = 4    ; Remove control style
   DCSTATE_GETFOCUS       = 5    ; Get control that has focus
   DCSTYLE_INVISIBLE      = 1    ; Set Control Invisible
   DCSTYLE_DISABLED       = 2    ; Set Control Disabled
   DCSTYLE_NOUSERDATA     = 4    ; Note: Setable via DialogControlState function ONLY SPINNER control only
   DCSTYLE_READONLY       = 8    ; Sets control to read-only (user cannot type in data) EDITBOX MULTILINEBOX SPINNER
   DCSTYLE_PASSWORD       = 16   ; Sets 'password mode' where only *'s are displayed EDITBOX
   DCSTYLE_DEFAULTBUTTON  = 32   ; Sets a button as a the default button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_DIGITSONLY     = 64   ; Set edit box to accept digits only EDITMOX MULTILINEBOX
   DCSTYLE_FLAT           = 128  ; Makes a 'flat' hyperlink-looking button PUSHBUTTON PICTUREBUTTON
   DCSTYLE_HEIGHT         = 256  ; Turns off automatic height adjustment on ItemBoxes and FileListBoxes
   DCSTYLE_CENTER         = 512  ; Center Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_RIGHT          = 1024 ; Right Justify Text in VARYTEXT and STATICTEXT Controls
   DCSTYLE_NOSELCURLEFT   = 2048 ; No selection, cursor left EDITBOX MULTILINEBOX
   DCSTYLE_NOSELCURRIGHT  = 4096 ; No selection, cursor right EDITBOX MULTILINEBOX

   ;DialogControlSet / DialogControlGet Constants
   DC_CHECKBOX            = 1    ; CHECKBOX
   DC_RADIOBUTTON         = 2    ; RADIOBUTTON
   DC_EDITBOX             = 3    ; EDITBOX MULTILINEBOX
   DC_TITLE               = 4    ; PICTURE RADIOBUTTON CHECKBOX PICTUREBUTTON VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON
   DC_ITEMBOXCONTENTS     = 5    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXSELECT       = 6    ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_CALENDAR            = 7    ; CALENDAR
   DC_SPINNER             = 8    ; SPINNER
   DC_MULTITABSTOPS       = 9    ; MULTILINEBOX
   DC_ITEMSCROLLPOS       = 10   ; ITEMBOX FILELISTBOX
   DC_BACKGROUNDCOLOR     = 11   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FILELISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_PICTUREBITMAP       = 12   ; PICTURE PICTUREBUTTON
   DC_TEXTCOLOR           = 13   ; RADIOBUTTON CHECKBOX VARYTEXT STATICTEXT GROUPBOX PUSHBUTTON ITEMBOX FIELLISTBOX DROPLISTBOX SPINNER EDITBOX MULTILINEBOX
   DC_ITEMBOXADD          = 14   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_ITEMBOXREMOVE       = 15   ; ITEMBOX FILELISTBOX DROPLISTBOX
   DC_RADIOCONTROL        = 16   ; RADIOBUTTON
   DC_POSITION            = 17   ; ALL CONTROLS

   ;DialogObject constants

   DLGOBJECT_ADDEVENT     = 1    ; Call dialog callback when the specified event occurs
   DLGOBJECT_REMOVEEVENT  = 2    ; Stop calling dialog callback when an event previously requested with
   DLGOBJECT_GETOBJECT    = 3    ; Return an object references to the specified control
   DLGOBJECT_GETPICOBJECT = 4    ; Create and return an object reference to a picture object

   ;Return code constants
   RET_DO_CANCEL          =  0   ; Cancels dialog
   RET_DO_DEFAULT         = -1   ; Continue with default processing for control
   RET_DO_NOT_EXIT        = -2   ; Do not exit the dialog

#EndSubRoutine

Return

Article ID:   W18352
Filename:   Resize Dialog UDFs.txt
File Created: 2011:10:31:08:54:28
Last Updated: 2011:10:31:08:54:28