Error on PanelScroll resizing the dialog

Error on PanelScroll resizing the dialog

Postby Silvio.Falconi » Tue Jul 03, 2018 4:11 pm

I have two error


Image



1. the brush of PanelScroll is black while I insert a gradient color
2. when resize the dialog the panel scroll make error

this is the test
Code: Select all  Expand view  RUN
#include "fivewin.ch"
#include "constant.ch"

Function Test()

   Local oDlg,oFont
   Local nBottom   := 28.4
   Local nRight    := 78.7
   local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   local nHeight := nBottom * DLG_CHARPIX_H

    Local oBtnHelp,oBtnOK,oBtnClose


   local oPanel
   local oBrushWhite
   local aGradientColor :=  { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }

   local nMINWidth := 628
   local nMINHeight := 570
   local nMAXWidth := GETSYSMETRICS( 0 ) //risoluzione orizzontale
   local nMAXHeight := GETSYSMETRICS( 1 ) //risoluzione verticale


   DEFINE BRUSH oBrushWhite GRADIENT  aGradientColor
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

 DEFINE DIALOG oDlg SIZE nWidth, nHeight PIXEL;
 FONT oFont    Title "Servizi Singoli"  ;
 STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

 oPanel:= TScrollPanel():New(40,5,100,308, oDlg, .t.)
oPanel:SetBrush( oBrushWhite )
 oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }


   @  10,250 BUTTON oBtnHelp PROMPT "Help" SIZE 40,15 PIXEL OF oDlg
   @ 195,200 BUTTON oBtnOK PROMPT "&Confirm" SIZE 40,15 PIXEL OF oDlg ACTION oDlg:End()
   @ 195,250 BUTTON oBtnClose PROMPT "&Exit" SIZE 40,15 PIXEL OF oDlg ACTION oDlg:End()

    oDlg:aMinMaxInfo = { GETSYSMETRICS( 0 ), GETSYSMETRICS( 1 ),;  // xMaxSize,      yMaxSize
                                                              0,  0,;  // xMaxPosition,  yMaxPosition
                                             nMINWidth,  nMINHeight,;  // xMinTrackSize, yMinTrackSize
                                             nMAXWidth, nMAXHeight }
 oDlg:bResized := { || ;
                   oRect                 := oDlg:GetCliRect(), ;
                   oBtnClose:nTop        := oRect:nBottom - 50, ;
                   oBtnClose:nLeft       := oRect:nRight - 100, ;
                   oBtnOK:nTop           := oRect:nBottom - 50, ;
                   oBtnOK:nLeft          := oRect:nRight - 200, ;
                   oBtnHelp:nLeft        := oRect:nRight - 100, ;
                   oPanel:nWidth         := oRect:nWidth - 10,  ;
                   oPanel:CheckResize(),  oPanel:setRange()}

 ACTIVATE DIALOG oDlg CENTERED ;
 ON INIT PANELBUTTON(oPanel)
 RETURN NIL

 //-------------------------------------------------------------//
FUNCTION   PANELBUTTON(oPanel)
              Local oBtn
   @ 1,2 BTNBMP oBtn  ;
        SIZE 190, 50 PIXEL;
         FLAT ;
        PROMPT "test" LEFT;
        OF oPanel ;
        TOOLTIP "fai click per aggiungere un servizio" ;
        COLOR CLR_RED,Rgb( 225,239,219) ;
        GRADIENT  { | lInvert | If( ! lInvert,;
                { { 1 ,RGB( 225, 225,225 ),   RGB( 229,241,251 ) } },;
                { { 1, RGB( 229,241,251 ),RGB( 225, 225, 225 ) } } ) }

   oPanel:CheckResize()
   oPanel:setRange()
    RETURN NIL



the problem come when I insert these commands

local nMINWidth := 628
local nMINHeight := 570
local nMAXWidth := GETSYSMETRICS( 0 ) //risoluzione orizzontale
local nMAXHeight := GETSYSMETRICS( 1 ) //risoluzione verticale

oDlg:aMinMaxInfo = { GETSYSMETRICS( 0 ), GETSYSMETRICS( 1 ),; // xMaxSize, yMaxSize
0, 0,; // xMaxPosition, yMaxPosition
nMINWidth, nMINHeight,; // xMinTrackSize, yMinTrackSize
nMAXWidth, nMAXHeight }

because I wish set max/min coordinates of dialog
this is the error

Code: Select all  Expand view  RUN
Application
===========
   Path and name: C:\Work\Errori\error_panelscrol\test.Exe (32 bits)
   Size: 3,592,192 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7600

   Time from start: 0 hours 0 mins 6 secs
   Error occurred at: 07/03/18, 18:10:57
   Error description: Error BASE/1004  No exported method: NTOP
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => NTOP( 0 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:VSETPOS( 216 )
   Called from: .\source\classes\SCRLPANL.PRG => TSCROLLPANEL:RESIZE( 140 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TSCROLLPANEL:HANDLEEVENT( 1731 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
   Called from:  => WNDWIDTH( 0 )
   Called from: .\source\classes\CONTROL.PRG => (b)TCONTROL( 179 )
   Called from: .\source\classes\CONTROL.PRG => TSCROLLPANEL:_NWIDTH( 0 )
   Called from: test.prg => (b)TEST( 52 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:RESIZE( 2227 )
   Called from: .\source\classes\DIALOG.PRG => (b)TDIALOG( 97 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:RESIZE( 0 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 922 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
   Called from: test.prg => TEST( 54 )


Any solution please ?
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: Error on PanelScroll resizing the dialog

Postby Silvio.Falconi » Tue Jul 03, 2018 4:34 pm

Now I try this release ( I created oPanel on a function ON INIT)

I cannot resize the Panel scroll , if I try to resize it make error
and the brush of panelscroll is allways black

Code: Select all  Expand view  RUN

#include "fivewin.ch"
#include "constant.ch"

Function Test()

   Local oDlg,oFont
   Local nBottom   := 28.4
   Local nRight    := 78.7
   local nWidth :=  Max( nRight * DLG_CHARPIX_W, 180 )
   local nHeight := nBottom * DLG_CHARPIX_H

    Local oBtnHelp,oBtnOK,oBtnClose


   local oPanel
   local oBrushWhite
   local aGradientColor :=  { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }

   local nMINWidth := 628
   local nMINHeight := 570
   local nMAXWidth := GETSYSMETRICS( 0 ) //risoluzione orizzontale
   local nMAXHeight := GETSYSMETRICS( 1 ) //risoluzione verticale


   DEFINE BRUSH oBrushWhite GRADIENT  aGradientColor
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

 DEFINE DIALOG oDlg SIZE nWidth, nHeight PIXEL;
 FONT oFont    Title "Servizi Singoli"  ;
 STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
              WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )


   @  10,250 BUTTON oBtnHelp PROMPT "Help" SIZE 40,15 PIXEL OF oDlg
   @ 195,200 BUTTON oBtnOK PROMPT "&Confirm" SIZE 40,15 PIXEL OF oDlg ACTION oDlg:End()
   @ 195,250 BUTTON oBtnClose PROMPT "&Exit" SIZE 40,15 PIXEL OF oDlg ACTION oDlg:End()


    oDlg:aMinMaxInfo = { GETSYSMETRICS( 0 ), GETSYSMETRICS( 1 ),;  // xMaxSize,      yMaxSize
                                                              0,  0,;  // xMaxPosition,  yMaxPosition
                                             nMINWidth,  nMINHeight,;  // xMinTrackSize, yMinTrackSize
                                             nMAXWidth, nMAXHeight }



 oDlg:bResized := { || ;
                   oRect                 := oDlg:GetCliRect(), ;
                   oBtnClose:nTop        := oRect:nBottom - 50, ;
                   oBtnClose:nLeft       := oRect:nRight - 100, ;
                   oBtnOK:nTop           := oRect:nBottom - 50, ;
                   oBtnOK:nLeft          := oRect:nRight - 200, ;
                   oBtnHelp:nLeft        := oRect:nRight - 100 }//, ; // oPanel:nWidth         := oRect:nRight - 10  }

 ACTIVATE DIALOG oDlg CENTERED ;
 ON INIT PANELBUTTON(oPanel,oDlg,oBrushWhite)
 RETURN NIL

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

FUNCTION   PANELBUTTON(oPanel,oDlg,oBrushWhite)
   Local oBtn
   Local oRect := oDlg:GetCliRect()


 oPanel:= TScrollPanel():New(80,5,180,oRect:nRight - 10,oDlg, .t.)
 oPanel:SetBrush( oBrushWhite )
 oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }


   @ 1,2 BTNBMP oBtn  ;
        SIZE 190, 50 PIXEL;
         FLAT ;
        PROMPT "test" LEFT;
        OF oPanel ;
        TOOLTIP "fai click per aggiungere un servizio" ;
        COLOR CLR_RED,Rgb( 225,239,219) ;
        GRADIENT  { | lInvert | If( ! lInvert,;
                { { 1 ,RGB( 225, 225,225 ),   RGB( 229,241,251 ) } },;
                { { 1, RGB( 229,241,251 ),RGB( 225, 225, 225 ) } } ) }



   oPanel:CheckResize()
   oPanel:setRange()

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

Re: Error on PanelScroll resizing the dialog

Postby nageswaragunupudi » Tue Jul 03, 2018 6:24 pm

A small sample of resizable ScrollPanel with gradient:
Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oDlg, oPanel

   DEFINE DIALOG oDlg SIZE 600,600 PIXEL TRUEPIXEL ; //RESIZABLE
      STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, ;
                   WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oPanel := CreatePanel( oDlg ) )

return nil

function CreatePanel( oDlg )

   local oPanel
   local aGrad  := { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }

   local c1    := "Hello World       "
   local c2    := Space( 100 )

   oDlg:aMinMaxInfo := { nil, nil, nil, nil, 300, 300, nil, nil }

   oPanel   := TScrollPanel():New( 050,050,550,550,oDlg, .t. )
   oPanel:nRightMargin     := 50
   oPanel:nBottomMargin    := 50
   oPanel:Gradient( aGrad )
   oPanel:bResized         := { || oPanel:Gradient( aGrad ) }

   @ 40,20 GET c1 SIZE 200,24 PIXEL OF oPanel
   @ 80,20 GET c2 SIZE 200,24 PIXEL OF oPanel

   oPanel:SetRange()

return oPanel
 
Regards

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

Re: Error on PanelScroll resizing the dialog

Postby Silvio.Falconi » Tue Jul 03, 2018 8:16 pm

you're fantastic
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 49 guests