resize a dialog from resources

resize a dialog from resources

Postby Rick Lipkin » Mon May 23, 2011 10:05 pm

To All

I have been asked to allow my dialog embeded with 2 xbrowses from resource to be able to maximize.

Is there a way to auto-resize the dialog and the elements within the resource ?

Thanks
Rick Lipkin

Image

Image

Code: Select all  Expand view

DEFINE BRUSH oBrush FILENAME (cDEFA+"\grey.bmp" )
DEFINE ICON oICO RESOURCE "WORLD"

DEFINE DIALOG oGRPS RESOURCE "VENDOR" ;
       ICON oICO                   ;
       TITLE cTITLE BRUSH oBrush TRANSPARENT

   REDEFINE xBROWSE oLBX1                ;
       RECORDSET oRsWeb                  ;
       COLUMNS "Run_This",               ;
               "URL"                     ;
       COLSIZES 30,200                   ;
       HEADERS "Run",                    ;
               "Web Site to Search"      ;
       ID 111 of oGrps                   ;
       AUTOSORT FASTEDIT LINES CELL

       oLbx1:bClrRowFocus    := { || { CLR_BLACK, RGB(185,220,255) } }
       oLbx1:nMarqueeStyle   := MARQSTYLE_HIGHLROWMS

       if ! Empty( oCol := oLbx1:oCol( "Run" ) )
            oCol:SetCheck( { "ON", "OFF" } )
            oCol:cSortOrder  := nil
          //  oCol:lBmpStretch = .T.
       endif

       AEVAL( oLbx1:aCols, { |o| o:nEditType := EDIT_GET } )

       * COLSIZES 30,30,30,100,30,30       ;

   REDEFINE xBROWSE oLBX2                ;
       ARRAY aResults                    ;
       COLUMNS 1,2,3,4,5,6               ;
       HEADERS "Site",                   ;
               "Part",                   ;
               "Name",                   ;
               "Desc",                   ;
               "Price",                  ;
               "Qty"                     ;
       ID 121 of oGrps                   ;
       AUTOSORT AUTOCOLS FASTEDIT LINES CELL

    REDEFINE GET oPARTS   VAR cPARTS   ID 115 of oGRPS PICTURE "@!"UPDATE
    REDEFINE GET oSAY     var cSAY     ID 113 of oGRPS READONLY COLOR "N/W"

   REDEFINE BUTTON oBTN1 ID 112 of oGrps  //    ;    // add files
    *   ACTION ( _FileView("A"),;
    *            oLBX1:REFRESH(), SysReFresh(),;
    *            oLBX1:SetFocus() )

   REDEFINE BUTTON oBTN2 ID 114 of oGrps  //  ;    // edit files
     *  ACTION ( _FileView( "E"), ;
     *           oLBX1:REFRESH(), SysReFresh(),;
     *           oLBX1:SetFocus() )

   REDEFINE BUTTON oBTN3 ID 119 of oGrps  //  ;    // del files
     *  ACTION ( Delete_Um() )


   REDEFINE BUTTON oBTN10 ID 124 of oGrps  // ;    // view log file
    *   ACTION ( WaitRun( "NOTEPAD.EXE ERRORLOG.TXT" ) )

   REDEFINE BUTTON oBTN5 ID 117 of oGrps    ;    // run
       ACTION ( Search( cPARTS,lVISABLE,oRsWeb,oSAY,cSAY,oLbx1,oLbx2 ))

   REDEFINE BUTTON oBTN6 ID 118 of oGrps    ;    // quit
       ACTION ( dbCloseAll(), ;
                oGrps:END() )

ACTIVATE DIALOG oGrps NOWAIT          ;
       ON INIT( oLbx1:SetFocus(),oParts:Setfocus(),SysReFresh() );
       VALID ( IIF( !lOK, ExitPgm(.T., oRsWeb, @aResults ), .F. ))


RETURN( NIL )
 
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: resize a dialog from resources

Postby Antonio Linares » Tue May 24, 2011 12:39 am

Rick,

You have to do it programmatically:
Code: Select all  Expand view


    oDlg:bResized = { | nSizeType, nWidth, nHeight | ResizeControls( nSizeType, nWidth, nHeight, oDlg )  }

...

#define SIZE_MAXIMIZED 2

function ResizeControls( nSizeType, nWidth, nHeight, oDlg )

   if nSizeType == SIZE_MAXIMIZED
      oDlg:aControls[ 1 ]:SetSize( nWidth - 10, nHeight - 20 )
      ...
   endif

return nil

 
regards, saludos

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

Re: resize a dialog from resources

Postby Rick Lipkin » Tue May 24, 2011 12:20 pm

Antonio

Thanks for your help .. I searched for bResized in the \samples folder and found several examples .. will try to work my way through the code.

Appreciate your quick response.

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests