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 Editor version 6.X
plus
plus

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

Right Justify Static or Variable Text

 Keywords:  Right Justify Static or VaryText Variable Text

Doing the dllcall it's easy for me, here's an example of right justify:
;--------------------------------------------------------------------------;
;TxtRight : Right justifies a static or variable text.                     ;
;--------------------------------------------------------------------------;
;hdlg : dialog handle                                                      ;
;id   : wil control id                                                     ;
;--------------------------------------------------------------------------;
#definefunction TxtRight(hdlg,id)
  user32=strcat(dirwindows(1),"user32.dll")
  GWL_STYLE=-16
  SS_RIGHT=2 
  hst=dllcall(user32,long:"GetDlgItem",long:hdlg,long:99+id)
  os=dllcall(user32,long:"GetWindowLongA",long:hst,long:GWL_STYLE)
  dllcall(user32,long:"SetWindowLongA",long:hst,long:GWL_STYLE,long:os|SS_RIGHT)
#endfunction


#Definefunction dlgproc(hdlg,msg,id,p4,p5)
select msg
  case 0 ;Init
    DialogProcOptions(hdlg,2,1) ;Push buttons
    ;right txt
    TxtRight(hdlg,003)

  Case 2 ;Button pushed
    select id      
      case 1 ;Back

      return -2

      case 2
      return -1

    endselect
endselect
return -1
#endfunction


MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`Right text`
MyDialogX=-1
MyDialogY=-1
MyDialogWidth=318
MyDialogHeight=174
MyDialogNumControls=004
MyDialogProcedure=`dlgproc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0

MyDialog001=`081,153,036,012,PUSHBUTTON,DEFAULT,"OK",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`201,153,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`007,009,056,010,VARYTEXT,MyVariable1,"Right justify",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,"0|255|64"`
MyDialog004=`009,029,044,012,VARYTEXT,MyVariable2,"Normal",DEFAULT,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("MyDialog",1)

Article ID:   W15475
File Created: 2003:05:13:11:28:06
Last Updated: 2003:05:13:11:28:06