Dialog Resizing no right -RESOLVED

Dialog Resizing no right -RESOLVED

Postby Silvio.Falconi » Sun Dec 23, 2018 5:53 pm

I made a easy dialog wuth two xbrowse, 2 buttons, 2 says

When resize only the xbrowses and the says not resizing right , why ?

Image

Code: Select all  Expand view  RUN
 
  #include "FiveWin.ch"
    #include "xbrowse.ch"

Function Test()
Local oDlg,oBrw1,oBrw2
Local oSay[2]
Local oFonftBold
Local oBtnok,oBtnclose

USE CUSTOMER ALIAS CU


DEFINE FONT oFontBold NAME "TAHOMA" SIZE 0,-14 BOLD
DEFINE DIALOG oDlg SIZE 878, 570 PIXEL;   // SIZE 878, 570
             Title "Test Resize"  ;
              STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                       WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

 @ 0, 12 SAY oSay[1] Prompt "First xbrowse " size 100, 12  OF oDlg font  oFontBold
 @ 0, 52 SAY oSay[2] Prompt "Second xbrowse " size 100, 12  OF oDlg Font oFontBold

@ 2, 2 XBROWSE oBrw1 OF oDlg SIZE 200,90  ;
      AUTOCOLS ALIAS 'CUST' NOBORDER

   oBrw1:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw1:CreateFromCode()

@ 2, 28 XBROWSE oBrw2 OF oDlg SIZE 200,90  ;
      AUTOCOLS ALIAS 'CUST' NOBORDER

   oBrw2:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7
   oBrw2:CreateFromCode()



 

     oDlg:bResized := { || ;
                   oRect                   := oDlg:GetCliRect()      ,;
                   oBrw1:nHeight           := oRect:nBottom - 120    ,;
                   oBrw1:nWidth            := oRect:nLeft +420       ,;
                   oBrw2:nHeight           := oRect:nBottom - 120    ,;
                   oBrw2:nWidth            := oRect:nRight - 100     ,;
                   oBrw2:nleft             := oRect:nright -380      ,;
                   oBtnOK:nTop              := oRect:nBottom - 40    ,;
                   oBtnOK:nLeft             := oRect:nRight - 200    ,;
                   oBtnClose:nTop           := oRect:nBottom - 40    ,;
                   oBtnClose:nLeft          := oRect:nRight - 100    ,;
                   oSay[1]:nTop             := oRect:nTop +5         ,;
                   oSay[2]:nTop             := oRect:nTop +5         ,;
                   oSay[1]:nLeft            := oRect:nLeft +160      ,;
                   oSay[2]:nLeft            := oRect:nright -290      }


       @  10,250 Button oBtnClose   PROMPT "Exit" ;
                 SIZE 40,16 PIXEL OF oDlg  ;
                 ACTION  nil

     @ 195,200 Button oBtnOK     PROMPT "&Ok" ;
               SIZE 42,16 PIXEL OF oDlg  ;
               ACTION  nil

 ACTIVATE DIALOG oDlg CENTERED  ;
      ON INIT (ResizeDialog( oDlg,oBrw1,oBrw2,oBtnclose,oBtnok,oSay))

   RELEASE FONT oFontBold

   return nil

  //-------------------------------------------------------------//

       Function ResizeDialog( oDlg,oBrw1,oBrw2,oBtnclose,oBtnok,oSay)
          Local  oRect  := oDlg:GetCliRect()

          oBrw1:nHeight           := oRect:nBottom - 120
          oBrw1:nWidth            := oRect:nLeft +420
          oBrw2:nHeight           := oRect:nBottom - 120
          oBrw2:nWidth            := oRect:nright -500
          oBrw2:nleft             := oRect:nLeft +470

         oSay[1]:nTop         := oRect:nTop +5
         oSay[2]:nTop         := oRect:nTop +5
         oSay[1]:nLeft        := oRect:nLeft +160
         oSay[2]:nLeft        := oRect:nright -290

          oBtnClose:nTop        := oRect:nBottom - 40
          oBtnClose:nLeft       := oRect:nRight - 100
          oBtnOK:nTop           := oRect:nBottom - 40
          oBtnOK:nLeft          := oRect:nRight - 200

       return ni



when you resize the xbrowse rect must have the same meausure , how resolve ?
Last edited by Silvio.Falconi on Tue Dec 25, 2018 4:37 pm, edited 2 times in total.
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Dialog Resizing no right

Postby nageswaragunupudi » Tue Dec 25, 2018 2:14 pm

Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oDlg, oFont, oBold, oBrw1, oBrw2, oSay1, oSay2, oBtnOk, oBtnClose, m

   USE CUSTOMER NEW ALIAS CUST

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD

   DEFINE DIALOG oDlg SIZE 880,600 PIXEL TRUEPIXEL RESIZABLE FONT oFont

   @ 10, 40 SAY oSay1 PROMPT "First XBrowse"  SIZE 400,24 PIXEL OF oDlg CENTER FONT oBold
   @ 10,440 SAY oSay2 PROMPT "Second XBrowse" SIZE 400,24 PIXEL OF oDlg CENTER FONT oBold

   @ 45, 40 XBROWSE oBrw1 SIZE 400,-65 PIXEL OF oDlg DATASOURCE "CUST" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw1:CreateFromCode()

   @ 45,440 XBROWSE oBrw2 SIZE -40,-65 PIXEL OF oDlg DATASOURCE "CUST" ;
      AUTOCOLS CELL LINES NOBORDER

   oBrw2:CreateFromCode()


   @ 550,660 BUTTON oBtnClose PROMPT "CLOSE" SIZE 80,30 PIXEL OF oDlg
   @ 550,760 BUTTON oBtnOK    PROMPT "OK"    SIZE 80,30 PIXEL OF oDlg

   oDlg:bResized  := <||
      local oRect    := oDlg:GetCliRect()
      local x        := Int( oRect:nWidth / 2 )

      oSay1:nWidth   := x - 40
      oSay2:nLeft    := x
      oSay2:nWidth   := x - 40

      oBrw1:nWidth   := x - 40
      oBrw2:nLeft    := x

      oBtnClose:nLeft   := oRect:nRight - 220
      oBtnClose:nTop    := oRect:nBottom - 50

      oBtnOK:nLeft      := oRect:nRight - 120
      oBtnOK:nTop       := oRect:nBottom - 50

      return nil
      >

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont, oBold

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog Resizing no right

Postby Silvio.Falconi » Tue Dec 25, 2018 4:33 pm

THANKS NAGES
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests