FolderEx problem

FolderEx problem

Postby Silvio.Falconi » Wed Mar 24, 2021 10:21 am

I can't insert the title of the Folderex tab below the tab bitmap, see the picture

Image



the code

@ 3, 3 FOLDEREX oFolder PIXEL LEFT STRETCH;
PROMPT "&Generale", "&Stampe","Spiaggia", "Planning" ;
TAB HEIGHT 120 ;
BITMAPS aBitmaps ;
ALIGN FLDBMP_LEFT, FLDBMP_CENTER,FLDBMP_CENTER, FLDBMP_CENTER ;
FONT oTitle

oFolder:nLayOut := 2


@ 3,0 FOLDEREX oFld1 OF oFolder:aDialogs[ 1 ] PIXEL ;
PROMPT "Impostazione", "Visualizza", "Azienda" ;
TAB HEIGHT 30 FONT oFont

@ 3,10 FOLDEREX oFld2 OF oFolder:aDialogs[ 2 ] PIXEL ;
PROMPT "Predefinita", "Prenotazione", "Pagamento" ;
TAB HEIGHT 30 FONT oFont





run good only with ALIGN 0,0,0,0


Image



I wish in this mode

Image

any solution ?
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: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: FolderEx problem

Postby karinha » Wed Mar 24, 2021 6:44 pm

Example complete, please! .RAR
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FolderEx problem

Postby Marc Venken » Wed Mar 24, 2021 10:33 pm

No code to test, but have you tried the combination of 2 parameters ?.

this is xbrowse and mayby also used for folders. Give it a try

:nDataStrAlign := AL_CENTER + AL_BOTTOM
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1426
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: FolderEx problem

Postby Silvio.Falconi » Thu Mar 25, 2021 11:05 am

Marc Venken wrote:No code to test, but have you tried the combination of 2 parameters ?.

this is xbrowse and mayby also used for folders. Give it a try

:nDataStrAlign := AL_CENTER + AL_BOTTOM



ON METHOD PaintTB() CLASS TFolderEx THERE ARE ONLY DT_SINGLELINE, DT_VCENTER, DT_CENTER
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: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: FolderEx problem

Postby Silvio.Falconi » Thu Mar 25, 2021 11:33 am

karinha wrote:Example complete, please! .RAR


the test
Please change your folder fwh
local cFolder_Fivewin:="C:\work\fwh\"


Code: Select all  Expand view

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

 Function test()
    local oDlg, oFolder,oFont,oBold,oTitle
    local oFld1,oFld2
    local nBottom   := 42
    local nRight    := 123.2
    local nWidth    :=  Max( nRight * DLG_CHARPIX_W, 180 )
    local nHeight   := nBottom * DLG_CHARPIX_H
    local oBtnConferma,oBtnChiudi


    local cFolder_Fivewin:="C:\work\fwh\"
    local aBitmaps  := {cFolder_Fivewin+"
bitmaps\32x32\users.bmp",;
                        cFolder_Fivewin+"
bitmaps\32x32\delete.bmp",;
                        cFolder_Fivewin+"
bitmaps\32x32\fivetech.bmp",;
                        cFolder_Fivewin+"
bitmaps\32x32\quit.bmp",}

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



       DEFINE DIALOG oDlg SIZE nWidth, nHeight ;
          TITLE "
Configurazione" PIXEL FONT oFont;
            STYLE nOR(  WS_CAPTION, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

       @ 3, 3 FOLDEREX oFolder PIXEL LEFT STRETCH;
                PROMPT "
&Generale", "&Stampe","Spiaggia", "Planning" ;
                TAB HEIGHT 120 ;
                BITMAPS aBitmaps ;
                ALIGN FLDBMP_LEFT, FLDBMP_CENTER,FLDBMP_CENTER, FLDBMP_CENTER ;
                OF oDlg

        oFolder:nLayOut := 2

        @ 3,0 FOLDEREX oFld1 OF oFolder:aDialogs[ 1 ] PIXEL  ;
         PROMPT "
Impostazione", "Visualizza", "Azienda" ;
          TAB HEIGHT 30   FONT oFont

     @ 3,10 FOLDEREX oFld2 OF oFolder:aDialogs[ 2 ] PIXEL  ;
         PROMPT "
Predefinita", "Prenotazione", "Pagamento" ;
          TAB HEIGHT 30 FONT oFont



       @ 195,250 BUTTONBMP oBtnConferma;
     RESOURCE "
INVOICE_SAVE" ;
     PROMPT "
  Salva" SIZE 55,15 PIXEL OF  oDlg;
     TOOLTIP "
fai click per salvare";
     TEXTRIGHT FONT oTitle ;
     ACTION   ( oDlg:end( IDOK ) )

     @ 195,250 BUTTONBMP oBtnChiudi;
     RESOURCE "
INVOICE_EXIT" ;
     PROMPT "
  Chiudi" SIZE 55,15  PIXEL OF  oDlg;
     TOOLTIP "
fai click per chiudere";
     TEXTRIGHT FONT oTitle ;
     ACTION  ( oDlg:end( IDCANCEL ) )



       oDlg:bResized  := <||
                     oRect                := oDlg:GetCliRect()
                     oFolder:nWidth       := oRect:nRight-20
                     oFolder:nHeight      := oRect:nBottom-60

                     oFld1:nWidth  := oFolder:nWidth-140
                     oFld1:nHeight := oFolder:nHeight-20
                     oFld2:nWidth  := oFolder:nWidth-140
                     oFld2:nHeight := oFolder:nHeight-20

                     oBtnConferma:nTop    := oRect:nBottom - 34
                     oBtnConferma:nLeft   := oRect:nRight - 260
                     oBtnChiudi:nTop      := oRect:nBottom - 34
                     oBtnChiudi:nLeft     := oRect:nRight - 140

                     oFld1:refresh()
                     oFld2:refresh()
                      return nil
                            >






                            ACTIVATE DIALOG oDlg CENTERED  ;
                               ON INIT (EVAL( oDlg:bResized) )
   if oDlg:nresult == IDOK

   endif

    RELEASE FONT oFont
  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: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: FolderEx problem

Postby karinha » Thu Mar 25, 2021 3:23 pm

Que falta?

Code: Select all  Expand view

// SAMPLES\FOLDXSIL.PRG

#Include "fivewin.ch"
#Include "constant.ch"

FUNCTION test()

   LOCAL oDlg, oFolder, oFont, oBold, oTitle, oRect
   LOCAL oFld1, oFld2
   LOCAL nBottom   := 42
   LOCAL nRight    := 123.2
   LOCAL nWidth    :=  Max( nRight * DLG_CHARPIX_W, 180 )
   LOCAL nHeight   := nBottom * DLG_CHARPIX_H
   LOCAL oBtnConferma, oBtnChiudi
   // LOCAL cFolder_Fivewin := "C:\work\fwh\"
   LOCAL cFolder_Fivewin := "C:FWH1905"
   LOCAL aBitmaps  := { cFolder_Fivewin + "bitmaps\32x32\users.bmp", ;
                        cFolder_Fivewin + "bitmaps\32x32\delete.bmp", ;
                        cFolder_Fivewin + "bitmaps\32x32\fivetech.bmp", ;
                        cFolder_Fivewin + "bitmaps\32x32\quit.bmp", }

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

   DEFINE DIALOG oDlg SIZE nWidth, nHeight                ;
      TITLE "Configurazione in xHarbour" PIXEL FONT oFont ;
      STYLE nOR( WS_CAPTION, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

   @ 3, 3 FOLDEREX oFolder PIXEL LEFT STRETCH;
      PROMPT "&Generale", "&Stampe", "&Spiaggia", "&Planning"        ;
      ON PAINT TAB PaintTab( Self, nOption )                         ;
      TAB HEIGHT 120 ROUND 5 BITMAPS aBitmaps                        ;
      ALIGN FLDBMP_LEFT, FLDBMP_CENTER, FLDBMP_CENTER, FLDBMP_CENTER ;
      OPTION 2                                                       ;
      ON PAINT TEXT( If( nOption == ::nOption .and. nOption == 2, CLR_BLUE, CLR_BLACK ) ) OF oDlg

   oFolder:nLayOut := 2

   @ 3, 0 FOLDEREX oFld1 OF oFolder:aDialogs[ 1 ] PIXEL  ;
      PROMPT "&Impostazione", "&Visualizza", "&Azienda"  ;
      TAB HEIGHT 30   FONT oFont

   @ 3, 10 FOLDEREX oFld2 OF oFolder:aDialogs[ 2 ] PIXEL ;
      PROMPT "&Predefinita", "Prenotazione", "Pagamento" ;
      TAB HEIGHT 30 FONT oFont

   @ 195, 250 BUTTONBMP oBtnConferma;
      RESOURCE "INVOICE_SAVE" ;
      PROMPT "  &Salva" SIZE 55, 15 PIXEL OF  oDlg;
      TOOLTIP "fai click per salvare";
      TEXTRIGHT FONT oTitle ;
      ACTION   ( oDlg:end( IDOK ) )

   @ 195, 250 BUTTONBMP oBtnChiudi;
      RESOURCE "INVOICE_EXIT" ;
      PROMPT "  &Chiudi" SIZE 55, 15  PIXEL OF  oDlg;
      TOOLTIP "fai click per chiudere";
      TEXTRIGHT FONT oTitle ;
      ACTION  ( oDlg:end( IDCANCEL ) )

   oDlg:bResized  := < ||
   oRect                := oDlg:GetCliRect()
   oFolder:nWidth       := oRect:nRight - 20
   oFolder:nHeight      := oRect:nBottom - 60

   oFld1:nWidth  := oFolder:nWidth - 140
   oFld1:nHeight := oFolder:nHeight - 20
   oFld2:nWidth  := oFolder:nWidth - 140
   oFld2:nHeight := oFolder:nHeight - 20

   oBtnConferma:nTop    := oRect:nBottom - 34
   oBtnConferma:nLeft   := oRect:nRight - 260
   oBtnChiudi:nTop      := oRect:nBottom - 34
   oBtnChiudi:nLeft     := oRect:nRight - 140

   oFld1:refresh()
   oFld2:refresh()

   RETURN NIL
   >

   ACTIVATE DIALOG oDlg CENTERED  ;
      ON INIT ( Eval( oDlg:bResized ) )

   IF oDlg:nresult == IDOK

   ENDIF

   RELEASE FONT  oFont
   RELEASE FONT  oBold
   RELEASE FONT  oTitle

RETURN NIL

FUNCTION PaintTab( o, nOption )

   LOCAL hBrush, hBmp, nLastRow

   IF nOption == o:nOver .OR. nOption == o:nOption
      o:SetAlphaLevel( nOption, 255 )
   ELSE
      o:SetAlphaLevel( nOption, 50 )
   ENDIF
   
   IF nOption == o:nOption .and. nOption == 2
      hBmp = ReadBitmap( 0, "C:\FWH1905\bitmaps\backgrnd\MAGENTA.bmp" )
      hBrush = CreatePatternBrush( hBmp )
      DeleteObject( hBmp )
      IF o:nLayOut == 2
         nLastRow = o:aPos[ o:aLines[ o:aOrder[ 1 ] ][ 1 ] ][ 1 ] + o:nFolderHeight
         SetBrushOrgEx( o:hDC, nLastRow + 2, 1 )  
      ELSE
         SetBrushOrgEx( o:hDC, 2, 2 )
      ENDIF
      RETURN hBrush
   ENDIF  
   
RETURN o:SetFldColors( o, nOption )
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7804
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FolderEx problem

Postby Silvio.Falconi » Fri Mar 26, 2021 9:35 am

karinha wrote:Que falta?


this is your solution
Image

the text must be on bottom of image, NOT on over the image

But in your opinion, if I had problems to place the writing under the image, why did I create the topic to ask help ?
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: 7048
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 123 guests