Fwh19.05 - New Class TDockPnel

Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 1:12 pm

Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 2:03 pm

Christobal,
great job
thank You very much :D

It seems there is something missing in class TGRAPH :?:
I had a look at it, but couldn't find it.

//oGraph:SetArrayFonts( { oFont2, oFont, oFont1, oFont, oFontB, oFontE, oFont1, oFont1, oFontB } )
I disabled this line and it works perfect without problems.

Application
===========
Path and name: I:\___PANEL4\PANEL.exe (32 bits)
Size: 4,060,160 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20181011)
FiveWin version: FWH 19.05
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 06/04/19, 15:55:02
Error description: Warning BASE/1004 Message not found: TGRAPH:SETARRAYFONTS

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 2:48 pm

ukoenig wrote:Christobal,
great job
thank You very much :D

It seems there is something missing in class TGRAPH :?:
I had a look at it, but couldn't find it.

//oGraph:SetArrayFonts( { oFont2, oFont, oFont1, oFont, oFontB, oFontE, oFont1, oFont1, oFontB } )
I disabled this line and it works perfect without problems.

Application
===========
Path and name: I:\___PANEL4\PANEL.exe (32 bits)
Size: 4,060,160 bytes
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20181011)
FiveWin version: FWH 19.05
C compiler version: Borland/Embarcadero C++ 7.3 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 06/04/19, 15:55:02
Error description: Warning BASE/1004 Message not found: TGRAPH:SETARRAYFONTS

regards
Uwe :?:


Dear Uwe
Thanks
Yes, I have forgotten a commit and the error is given in an example.
Indeed, commenting on that line, it works perfectly
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 5:26 pm

Christobal,

another question about panel :

1. I create a panel inside a dialog
on top of the dialog are tabs

2. I fill the panel with objects defined in function1 from tab1

3. I want to refill the panel with defined objects from tab2 calling function2

the replacement works but I have to clear the panel before refill it with objects defined in different tabs
It means the panel is created only once like a box and refilled..

what is the best solution to clear the panel from objects ( NO close / create )

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 5:37 pm

Uwe, excuse me, my English is not good and I do not think I have understood what you are saying. An image or gif would be good to understand you better.
What you have at the top is a TAB control, or a Folder?
Without knowing if I answer your question well, I will dare to tell you the following: have you tried Hide and Show ?.
On the other hand, I mention that in my mind from the beginning is the evolution that I want to give this new control and its implementation within a higher level class called TDashBoard, not yet published, so that it is still easier for the user the organization of their data on the screens.
It is also possible to create a control type FolderEx that contains instead of dialogs as containers, this new control. This is also a beautiful project.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 5:48 pm

Christobal,

A message from Otto adding tabs for panel-changes

have you seen that there is also a TAB nnavigation.
We should have TAB to select different panels and then inside the panels we need to open and close icon bars.


The panel is painted on a dialog

Image

regards
Uwe :?:
Last edited by ukoenig on Tue Jun 04, 2019 5:54 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 5:53 pm

OK, yours panels or dialog have :lTransparent := .F. ?
Sorry, what container is used in each function of tab for paint buttons or controls?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 5:56 pm

Christobal,

YES NO transparent there is a defined panel-background-color

I think to delete everything defined in the panel with a for / next ?

just to show what I'm trying to do ( testing )

Tab 1 and panel is painted on init

@ 100, 0 TABS oTabs PROMPTS "&One", "&Two" OF oDlg PIXEL ;
BITMAPS "..\bitmaps\16x16\people.bmp", "..\bitmaps\open2.bmp",;
"..\bitmaps\16x16\print.bmp", "..\bitmaps\open2.bmp" ;
ACTION ( nTabPos := oTabs:nOption, ;
IIF( nTabPos = 2, PAINT_PANEL2( oDlg, oPanelScroll ) , PAINT_PANEL( oDlg, oPanelScroll ) ), ;
oPanelScroll:Refresh() )
oDlg:oTop = oTabs

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT( oPanelScroll := CreatePanel( oDlg, oGet, nTabPos ),; // created only once :!:
PAINT_PANEL( oDlg, oPanelScroll ),; // panel-contens to be changed
oPanelScroll:SetRange(),;
oPanelScroll:CheckResize() )


regards
Uwe :?:
Last edited by ukoenig on Tue Jun 04, 2019 6:10 pm, edited 7 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 5:59 pm

Can you send me a small example to my email?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 6:02 pm

More images TDockPnel

Image
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 7:01 pm

Christobal,

A test as small as possible
The panel starts with one buttonline on init
with tab 2 the panel changes to 4 buttonlines.
Back to tab 1 the panel must be empty before repainted.

http://www.pflegeplus.com/DOWNLOADS/Panel4.zip

regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 7:37 pm

I sent you mail with your sample
Have you received it?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby ukoenig » Tue Jun 04, 2019 8:31 pm

Christobal,

I didn't receive it, but sometimes it takes a little bit longer
I will check tomorrow again.

Thank You

regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 8:34 pm

Uwe, one moment
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Fwh19.05 - New Class TDockPnel

Postby cnavarro » Tue Jun 04, 2019 8:38 pm

Try with this

Code: Select all  Expand view


#include "FiveWin.ch"

STATIC oDlg, c_path, aValues
Static oPanel1, oPanel2, oTabs
Static aCtrls1, aCtrls2
Static oFont, oBold

FUNCTION MAIN()

   LOCAL oFont1, oFontG
   LOCAL oPanelScroll
   LOCAL oSay, oResize[8]
   LOCAL oGet, nTabPos := 1
   LOCAL cFind      := SPACE( 50 ), lDrag := .F.
   LOCAL nWidth := 850, nHeight := 500
   LOCAL nRowPos, nColPos, oBtnClose, oBtnMax, oBtnMin, oBtnDlg
   aCtrls1   := {}
   aCtrls2   := {}

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

   DEFINE FONT oFont1 NAME "Segoe UI Light" SIZE 0,-22
   DEFINE FONT oFontG NAME "Segoe UI" SIZE 0,-18

   c_path := cFilePath(GetModuleFileName( GetInstance() ) )

   aValues  := READ_INI1(c_path)

   DEFINE DIALOG oDlg  SIZE 850, 580 PIXEL TRUEPIXEL ;
      STYLE nOr( WS_POPUP ) COLOR aValues[2], aValues[1] // 14606046

   @ 2, oDlg:nWidth - 48 BTNBMP oBtnClose BITMAP c_path + "closew.png" ;
      FLAT NOBORDER NOROUND ;
      ACTION oDlg:End() SIZE 45, 24 ;
      COLOR CLR_BLACK, aValues[1]
   oBtnClose:cToolTip =  { "Close" + CRLF + "dialog","SYSTEM", 1, CLR_BLACK, 14089979 }

   // on change must clear the panel !
   // ---------------------------------------
   @ 100, 0 TABS oTabs PROMPTS "&One", "&Two" OF oDlg PIXEL  ;
      BITMAPS c_path + "people.bmp", c_path + "open2.bmp" ;
      ACTION ( Paint_Panel( oPanelScroll ), oPanelScroll:Refresh() )

   oDlg:oTop = oTabs

   // starts with 1 button-line on tab 1

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT( oPanelScroll := CreatePanel( oDlg ),;
               Paint_Panel( oPanelScroll ), ;
               oPanelScroll:SetRange(),;
                  oPanelScroll:CheckResize() )

   RELEASE FONT oFont1, oFontG
   RELEASE FONT oFont, oBold

RETURN NIL

//--------------- Create the panel only once ----------

FUNCTION CREATEPANEL( oDlg )

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

   // New( nTop, nLeft, nBottom, nRight, oWnd, lDesign, cVarName, lBorder )
   oPanel1              := TScrollPanel():New( 120, 010,    350,         810,   oDlg, .t. )
   oPanel1:nRightMargin := 20
   oPanel1:nBottomMargin  := 20
   oPanel1:WinStyle(WS_BORDER, .f.)
   oPanel1:setcolor( aValues[4], aValues[3] ) //  14606046, 14606046)

RETURN oPanel1

// ----------------------- Fill the panel with tab 2 ----------

STATIC FUNCTION PAINT_PANEL( oPanel )

   LOCAL x
   LOCAL oBtn
   LOCAL nRow              := 10
   LOCAL nCol              := 10
   LOCAL nClrText       := aValues[6]
   LOCAL nClrBack       := aValues[3]
   LOCAL nClrBorder := aValues[7]
   LOCAL nBtnColor      := aValues[5]
   LOCAL aBtns
   LOCAL lSw          := .T.

   AEval( oPanel:aControls, { | o | o:Hide() } )

   DO CASE
      CASE oTabs:nOption = 1
          aBtns    := { ;
                      { "System" + CRLF + "Screen, notifications," + CRLF + "power", 0xE770, { || BTN_ACTION(oDlg) } }, ;
                      { "Devices" + CRLF + "Bluetooth, printers," + CRLF + "mouse", 0xE772, { || BTN_ACTION(oDlg) } }, ;
                      { "Mobile" + CRLF + "Link your Android, iPhone" + CRLF, 0xE1C9, { || BTN_ACTION(oDlg) } }, ;
                      { "Network && Internet" + CRLF + "WIFI, flight mode" + CRLF + "VPN", 0xE12b, { || BTN_ACTION(oDlg) } }, ;
                      { "Personalization" + CRLF + "Background, lock screen" + CRLF, 0xE771, { || BTN_ACTION(oDlg) } }, ;
                      { "Apps" + CRLF + "Uninstall defaults" + CRLF + "Optional Features", 0xE179, { || BTN_ACTION(oDlg) } }, ;
                      { "Account" + CRLF + "Your account, email sync" + CRLF + "Work family", 0xE77B, { || BTN_ACTION(oDlg) } }, ;
                      { "Time and language" + CRLF + "Voice, region, date" + CRLF, 0xE775, { || BTN_ACTION(oDlg) } }, ;
                      { "Games" + CRLF + "Game bar, DVR," + CRLF + "retransmission and game mode", 0xE909, { || BTN_ACTION(oDlg) } }, ;
                      { "Accessibility" + CRLF + "Narrator, magnifying glass," + CRLF + "high contrast", 0xE776, { || BTN_ACTION(oDlg) } }, ;
                      { "Cortana" + CRLF + "Language of Cortana," + CRLF + "permissions, notifications", 0xECCA, { || BTN_ACTION(oDlg) } }, ;
                      { "Privacy" + CRLF + "Location Camera" + CRLF, 0xE1F6, { || BTN_ACTION(oDlg) } }, ;
                      { "Update && Security" + CRLF + "Windows Update" + CRLF + "Recovery", 0xE777, { || BTN_ACTION(oDlg) } } ;
                     }
          if Len( aCtrls1 ) > 0
             lSw    := .F.
             AEVal( aCtrls1, { | o | o:Show() } )
          endif
      CASE oTabs:nOption = 2
          aBtns    := { ;
                      { "System" + CRLF + "Screen, notifications," + CRLF + "power", 0xE770, { || BTN_ACTION(oDlg) } }, ;
                      { "Devices" + CRLF + "Bluetooth, printers," + CRLF + "mouse", 0xE772, { || BTN_ACTION(oDlg) } }, ;
                      { "Mobile" + CRLF + "Link your Android, iPhone" + CRLF, 0xE1C9, { || BTN_ACTION(oDlg) } }, ;
                      { "Network && Internet" + CRLF + "WIFI, flight mode" + CRLF + "VPN", 0xE12b, { || BTN_ACTION(oDlg) } }, ;
                      { "Update && Security" + CRLF + "Windows Update" + CRLF + "Recovery", 0xE777, { || BTN_ACTION(oDlg) } } ;
                     }
          if Len( aCtrls2 ) > 0
             lSw    := .F.
             AEVal( aCtrls2, { | o | o:Show() } )
          endif
   ENDCASE

   if lSw
      FOR x = 1 to Len( aBtns )
          IF x > 1
            IF Mod( x, 5 ) = 1
               nRow += 140
               nCol := 10
            ELSE
               nCol += 200
            ENDIF
          ENDIF
          @ nRow, nCol BTNBMP oBtn PROMPT aBtns[ x ][ 1 ]  ;
            RESOURCE aBtns[ x ][ 2 ] SIZE 190, 140 PIXEL OF oPanel FLAT NOBORDER ;
            COLOR nClrText, nClrBack
         WITH OBJECT oBtn
               :bAction     := aBtns[ x ][ 3 ]
               :nClrBorder  := nClrBorder
               :bColorMap   := { | o | o:lBorder := o:lMOver, nBtnColor }
               :oFontBold   := oBold
               :lRound      := .F.
         END
         if oTabs:nOption = 1
            AAdd( aCtrls1, oBtn )
         endif
         if oTabs:nOption = 2
            AAdd( aCtrls1, oBtn )
         endif
      NEXT x
   endif

RETURN NIL

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


STATIC FUNCTION BTN_ACTION( oDlg )

   //MsgAlert( "Action of button : " + cButton, "Selected button" )
   MsgAlert( "Action of button : ", "Selected button" )

RETURN NIL

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

STATIC FUNCTION DUMMY()
   MsgAlert( "Action from GET", "Attention" )
RETURN NIL

//----------------------------------------------------------------------------//
// --------- INI - Read -------------

FUNCTION READ_INI1(c_path)

   LOCAL cIniFile := c_path + "SETTINGS1.INI", aVal[10]

   aVal[01] := Val(GetPvProfString("Colors", "Dialog",      "13816530", cIniFile ) )
   aVal[02] := Val(GetPvProfString("Colors", "DText",       "0",            cIniFile ) )
   aVal[03] := Val(GetPvProfString("Colors", "Panel",       "14935011", cIniFile ) )
   aVal[04] := Val(GetPvProfString("Colors", "PText",       "0",            cIniFile ) )
   aVal[05] := Val(GetPvProfString("Colors", "Button",      "8421376",  cIniFile ) )
   aVal[06] := Val(GetPvProfString("Colors", "BText",       "255",      cIniFile ) )
   aVal[07] := Val(GetPvProfString("Colors", "Focus",       "0",            cIniFile ) )
   aVal[08] := Val(GetPvProfString("Colors", "Dialog 2",    "16763283",     cIniFile ) )
   aVal[09] := IIF(GetPvProfString("Colors", "Border"".T.",          cIniFile ) == ".T." , .T. , .F. )
   aVal[10] := IIF(GetPvProfString("Dialog", "Resize"".T.",          cIniFile ) == ".T." , .T. , .F. )

RETURN aVal

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

 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 64 guests