Resizing button on dialog

Resizing button on dialog

Postby Silvio.Falconi » Tue May 23, 2017 9:10 pm

I have a dialog with some buttons
I wish use a dialog with WS_OVERLAPPED style
When the use resize the dialog the buttons must move and resize ( height,width)
How I can make ?

Image

I made this is a test it run the buttos are moved but the size of each buttons are the same
How I can to change also the width and height of each button simulating a zoom ?

Code: Select all  Expand view


 

#include "FiveWin.ch"
#include "constant.ch"
#include "Tsbutton.ch"


#DEFINE BTNSIZE_H  40
#DEFINE BTNSIZE_W  40

Function test()
Local oDlg
Local aBtnsLines[12]
Local aBtnsProdu[24]


   Local nBottom   := 41
   Local nRight    := 110
   Local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   Local nHeight := nBottom * DLG_CHARPIX_H



DEFINE DIALOG oDlg      ;
   TITLE "test"    ;
   SIZE nWidth, nHeight  TRANSPARENT PIXEL

   oDlg:nStyle    := nOr( WS_OVERLAPPED,WS_THICKFRAME,WS_SYSMENU,WS_MAXIMIZEBOX,   0  )


                 @   5,190 SBUTTON aBtnsLines[ 1] OF  oDlg  SIZE 40, 30 PIXELS
                 @   5,232 SBUTTON aBtnsLines[ 2] OF  oDlg  SIZE 40, 30 PIXELS
                 @   5,274 SBUTTON aBtnsLines[ 3] OF  oDlg  SIZE 40, 30 PIXELS
                 @   5,316 SBUTTON aBtnsLines[ 4] OF  oDlg  SIZE 40, 30 PIXELS
                 @  37,190 SBUTTON aBtnsLines[ 5] OF  oDlg  SIZE 40, 30 PIXELS
                 @  37,232 SBUTTON aBtnsLines[ 6] OF  oDlg  SIZE 40, 30 PIXELS
                 @  37,274 SBUTTON aBtnsLines[ 7] OF  oDlg  SIZE 40, 30 PIXELS
                 @  37,316 SBUTTON aBtnsLines[ 8] OF  oDlg  SIZE 40, 30 PIXELS
                 @  69,190 SBUTTON aBtnsLines[ 9] OF  oDlg  SIZE 40, 30 PIXELS
                 @  69,232 SBUTTON aBtnsLines[10] OF  oDlg  SIZE 40, 30 PIXELS
                 @  69,274 SBUTTON aBtnsLines[11] OF  oDlg  SIZE 40, 30 PIXELS
                 @  69,316 SBUTTON aBtnsLines[12] OF  oDlg  SIZE 40, 30 PIXELS

                 @  108,190 SBUTTON aBtnsProdu[ 1] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  108,232 SBUTTON aBtnsProdu[ 2] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  108,274 SBUTTON aBtnsProdu[ 3] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  108,316 SBUTTON aBtnsProdu[ 4] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  140,190 SBUTTON aBtnsProdu[ 5] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  140,232 SBUTTON aBtnsProdu[ 6] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  140,274 SBUTTON aBtnsProdu[ 7] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  140,316 SBUTTON aBtnsProdu[ 8] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  172,190 SBUTTON aBtnsProdu[ 9] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  172,232 SBUTTON aBtnsProdu[10] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  172,274 SBUTTON aBtnsProdu[11] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  172,316 SBUTTON aBtnsProdu[12] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  204,190 SBUTTON aBtnsProdu[13] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  204,232 SBUTTON aBtnsProdu[14] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  204,274 SBUTTON aBtnsProdu[15] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  204,316 SBUTTON aBtnsProdu[16] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  236,190 SBUTTON aBtnsProdu[17] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  236,232 SBUTTON aBtnsProdu[18] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  236,274 SBUTTON aBtnsProdu[19] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  236,316 SBUTTON aBtnsProdu[20] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  268,190 SBUTTON aBtnsProdu[21] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  268,232 SBUTTON aBtnsProdu[22] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  268,274 SBUTTON aBtnsProdu[23] OF  oDlg SIZE 40, 30 PIXELS OFFICE
                 @  268,316 SBUTTON aBtnsProdu[24] OF  oDlg SIZE 40, 30 PIXELS OFFICE

                 


 oDlg:bResized := {|| Rinfresca_oDlg(nHeight,nWidth,oDlg,  aBtnsLines,aBtnsProdu   )  }


 ACTIVATE DIALOG oDlg CENTERED ;
             ON INIT  Rinfresca_oDlg(nHeight,nWidth,oDlg,  aBtnsLines,aBtnsProdu   );
             ON PAINT ( aRct := GetClientRect( oDlg:hWnd ), ;
                       GradColor(oDlg:hDC, aRct, CLR_BLUE, LightColor(100, CLR_HGRAY) ))
return nil
//----------------------------------------------------------------------------------------------//
Function Rinfresca_oDlg(nHeight,nWidth,oDlg,  aBtnsLines,aBtnsProdu   )
   Local i
   Local  oRect := oDlg:GetCliRect()

                   aBtnsLines[01]:nTop := oRect:nBottom - 630
                   aBtnsLines[02]:nTop := oRect:nBottom - 630
                   aBtnsLines[03]:nTop := oRect:nBottom - 630
                   aBtnsLines[04]:nTop := oRect:nBottom - 630
                   aBtnsLines[01]:nLeft := oRect:nRight - (355+ aBtnsLines[09]:nWidth)
                   aBtnsLines[02]:nLeft := oRect:nRight - (270+ aBtnsLines[10]:nWidth)
                   aBtnsLines[03]:nLeft := oRect:nRight - (185+ aBtnsLines[11]:nWidth)
                   aBtnsLines[04]:nLeft := oRect:nRight - (100+ aBtnsLines[12]:nWidth)

                   aBtnsLines[05]:nTop := oRect:nBottom - 565
                   aBtnsLines[06]:nTop := oRect:nBottom - 565
                   aBtnsLines[07]:nTop := oRect:nBottom - 565
                   aBtnsLines[08]:nTop := oRect:nBottom - 565
                   aBtnsLines[05]:nLeft := oRect:nRight - (355+ aBtnsLines[09]:nWidth)
                   aBtnsLines[06]:nLeft := oRect:nRight - (270+ aBtnsLines[10]:nWidth)
                   aBtnsLines[07]:nLeft := oRect:nRight - (185+ aBtnsLines[11]:nWidth)
                   aBtnsLines[08]:nLeft := oRect:nRight - (100+ aBtnsLines[12]:nWidth)

                   aBtnsLines[09]:nTop := oRect:nBottom - 500
                   aBtnsLines[10]:nTop := oRect:nBottom - 500
                   aBtnsLines[11]:nTop := oRect:nBottom - 500
                   aBtnsLines[12]:nTop := oRect:nBottom - 500
                   aBtnsLines[09]:nLeft := oRect:nRight - (355+ aBtnsLines[09]:nWidth)
                   aBtnsLines[10]:nLeft := oRect:nRight - (270+ aBtnsLines[10]:nWidth)
                   aBtnsLines[11]:nLeft := oRect:nRight - (185+ aBtnsLines[11]:nWidth)
                   aBtnsLines[12]:nLeft := oRect:nRight - (100+ aBtnsLines[12]:nWidth)



                   aBtnsProdu[01]:nTop := oRect:nBottom - 395
                   aBtnsProdu[02]:nTop := oRect:nBottom - 395
                   aBtnsProdu[03]:nTop := oRect:nBottom - 395
                   aBtnsProdu[04]:nTop := oRect:nBottom - 395
                   aBtnsProdu[01]:nLeft:= oRect:nRight - (355+ aBtnsProdu[21]:nWidth)
                   aBtnsProdu[02]:nLeft:= oRect:nRight - (270+ aBtnsProdu[22]:nWidth)
                   aBtnsProdu[03]:nLeft:= oRect:nRight - (185+ aBtnsProdu[23]:nWidth)
                   aBtnsProdu[04]:nLeft:= oRect:nRight - (100+ aBtnsProdu[24]:nWidth)



                   aBtnsProdu[05]:nTop := oRect:nBottom - 330
                   aBtnsProdu[06]:nTop := oRect:nBottom - 330
                   aBtnsProdu[07]:nTop := oRect:nBottom - 330
                   aBtnsProdu[08]:nTop := oRect:nBottom - 330
                   aBtnsProdu[05]:nLeft:= oRect:nRight - (355+ aBtnsProdu[21]:nWidth)
                   aBtnsProdu[06]:nLeft:= oRect:nRight - (270+ aBtnsProdu[22]:nWidth)
                   aBtnsProdu[07]:nLeft:= oRect:nRight - (185+ aBtnsProdu[23]:nWidth)
                   aBtnsProdu[08]:nLeft:= oRect:nRight - (100+ aBtnsProdu[24]:nWidth)

                   aBtnsProdu[09]:nTop := oRect:nBottom - 265
                   aBtnsProdu[10]:nTop := oRect:nBottom - 265
                   aBtnsProdu[11]:nTop := oRect:nBottom - 265
                   aBtnsProdu[12]:nTop := oRect:nBottom - 265
                   aBtnsProdu[09]:nLeft:= oRect:nRight - (355+ aBtnsProdu[21]:nWidth)
                   aBtnsProdu[10]:nLeft:= oRect:nRight - (270+ aBtnsProdu[22]:nWidth)
                   aBtnsProdu[11]:nLeft:= oRect:nRight - (185+ aBtnsProdu[23]:nWidth)
                   aBtnsProdu[12]:nLeft:= oRect:nRight - (100+ aBtnsProdu[24]:nWidth)

                   aBtnsProdu[13]:nTop := oRect:nBottom - 200
                   aBtnsProdu[14]:nTop := oRect:nBottom - 200
                   aBtnsProdu[15]:nTop := oRect:nBottom - 200
                   aBtnsProdu[16]:nTop := oRect:nBottom - 200
                   aBtnsProdu[13]:nLeft:= oRect:nRight - (355+ aBtnsProdu[21]:nWidth)
                   aBtnsProdu[14]:nLeft:= oRect:nRight - (270+ aBtnsProdu[22]:nWidth)
                   aBtnsProdu[15]:nLeft:= oRect:nRight - (185+ aBtnsProdu[23]:nWidth)
                   aBtnsProdu[16]:nLeft:= oRect:nRight - (100+ aBtnsProdu[24]:nWidth)

                   aBtnsProdu[17]:nTop := oRect:nBottom - 135
                   aBtnsProdu[18]:nTop := oRect:nBottom - 135
                   aBtnsProdu[19]:nTop := oRect:nBottom - 135
                   aBtnsProdu[20]:nTop := oRect:nBottom - 135
                   aBtnsProdu[17]:nLeft:= oRect:nRight - (355+ aBtnsProdu[17]:nWidth)
                   aBtnsProdu[18]:nLeft:= oRect:nRight - (270+ aBtnsProdu[18]:nWidth)
                   aBtnsProdu[19]:nLeft:= oRect:nRight - (185+ aBtnsProdu[19]:nWidth)
                   aBtnsProdu[20]:nLeft:= oRect:nRight - (100+ aBtnsProdu[20]:nWidth)



                   aBtnsProdu[21]:nTop := oRect:nBottom - 70
                   aBtnsProdu[22]:nTop := oRect:nBottom - 70
                   aBtnsProdu[23]:nTop := oRect:nBottom - 70
                   aBtnsProdu[24]:nTop := oRect:nBottom - 70
                   aBtnsProdu[21]:nLeft:= oRect:nRight - (355+ aBtnsProdu[21]:nWidth)
                   aBtnsProdu[22]:nLeft:= oRect:nRight - (270+ aBtnsProdu[22]:nWidth)
                   aBtnsProdu[23]:nLeft:= oRect:nRight - (185+ aBtnsProdu[23]:nWidth)
                   aBtnsProdu[24]:nLeft:= oRect:nRight - (100+ aBtnsProdu[24]:nWidth)



   return nil

 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: Resizing button on dialog

Postby Antonio Linares » Wed May 24, 2017 8:53 pm

Silvio,

Can you use BUTTON instead of SBUTTON ?

SBUTTON is not a standard class of FWH, so I can't build your example
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Resizing button on dialog

Postby Silvio.Falconi » Wed May 24, 2017 10:03 pm

Sorry,
but I must use sbutton because I'm making a touch simulation tpv
on next release I must use fwh control standard

for the problem i resolved ,I found on forum thanks to Frank Demont I found an oldest mail
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: Resizing button on dialog

Postby Otto » Thu May 25, 2017 6:17 am

Which?
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6313
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests