How to use Folder-pages defined in special functions ?

How to use Folder-pages defined in special functions ?

Postby ukoenig » Thu Aug 14, 2008 3:04 pm

Hello,

during my work on the new xBrowse-tools, i have a problem with Folders :
In all FWH-samples, the pages are included in the main-dialog.
In my old sources, i have done the same with no problem.
But now, because of many options, i have to write a extra function for each page.
When i do it, i cannot see the browsers.
As a test, i included the first browser in the main-dialog.
Then, i can see the browser. The slider, i couldn't show, because he is included in FUNCTION BRWGRAD(oDlg,oFld) as well.

There was a problem with sliders and pages.
I have done some tests with FWH-sample Testfld6.prg
after some tryouts, i got it working but the prg-structure is different there.

Image

To carry on, i included the pages to the main-function :
The 1. Page belongs to Header- and Footer - Size and Gradients.
Page 2 will be bitmap- and background preview
Page 3 will be Line-defines.
some more will follow

The 1. page will be finished today and can be used allready for
xBrowse - header / footer-design.
I have still to add the color-control-fields.
Maybe it is better to change text : 3. Color in < Rollover > ? ( for Mouse )

Is it possible, to have different fonts for Header + Footer and Data ?
Otherwise i will use the selected font in all parts.

Image

Code: Select all  Expand view

#include "FiveWin.ch"
#include "xBrowse.ch"
#include "folder.ch"
#include "Slider.ch"

static oWnd, oFld

FUNCTION Main()

local oBar, oBtn1

DEFINE WINDOW oWnd TITLE "xBROWSE" MDI MENU TMenu():New()

DEFINE BUTTON oBtn1 OF oBar ACTION ( Tools(oWnd,oBar,oBtn1),  lOPEN := .T., oBtn1:Disable() ) ;
RESOURCE "magic" PROMPT "xBrowse-Selection" TOOLTIP "xBROWSE-Settings"

...
...

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT gradpaint1( hDC, oWnd ) ;
VALID MsgYesNo( "Do you want to end?" )

RETURN NIL

//-----------------  DIALOG ----------------------------------------------//

FUNCTION Tools(oWnd,oBar,oBtn1)
local oDlg

nFOLDERPOS := 1

DEFINE DIALOG oDlg RESOURCE "Dialog" OF oWnd TITLE  "xBROWSE-Color-Selection" FONT oProgFont

...
...


REDEFINE FOLDER oFld ID 110 OF oDlg  ;
PROMPTS "  &Header / Footer  ", "  &Bitmaps  ", "  &Cell-Lines  "  ;
DIALOGS "Browse1","Browse2","Browse3" ;
ON CHANGE( nFOLDERPOS := SetOption(oFld:nOption), ;
  IIF( nFOLDERPOS = 1, BRWGRAD(oDlg,oFld), NIL ), ;
  IIF( nFOLDERPOS = 2, BRWBMP(oDlg,oFld), NIL ), ;
  IIF( nFOLDERPOS = 3, BRWCELL(oDlg,oFld), NIL ), oFld:Refresh() )

...
...

ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON PAINT gradpaint2( hDC, oDlg ) ;
ON INIT ( oDlg:Move( 50 , 20, oDlg:nWidth, oDlg:nHeight, .f. ), ;
               SetDialogsGradient( oFld ) )

RETURN ( NIL )

// ---------------------- FOLDER 1 --------------------

FUNCTION BRWGRAD(oDlg,oFld)
LOCAL oLbx3

// ---  START - COLOR -------------------------------

oLbx3 := TXBrowse():New( oFld:aDialogs[1] )
oLbx3:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbx3:nColDividerStyle    := LINESTYLE_BLACK
oLbx3:nRowDividerStyle := LINESTYLE_BLACK
oLbx3:nRecSelColor = 15512898
oLbx3:bClrSelFocus = { || { 16777215, 15512898 } }
oLbx3:bClrSel = { || { 16777215, 15512898 } }
...
...

oLbx3:CreateFromResource( 110 )

RETURN( NIL )




Any solution ?

Regards
Uwe :lol:
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

Postby Antonio Linares » Sat Aug 16, 2008 7:03 am

Uwe,

Please try this:
Code: Select all  Expand view
#include "FiveWin.ch"
#include "XBrowse.ch"

function Main()

   local oDlg, oFld, oBrw1, oBrw2
   local aDat1, aDat2

   aDat1:={{"Row1-Col1","Row1-Col2","Row1-Col3"},;
                 {"Row2-Col1","Row2-Col2","Row2-Col3"},;
                 {"Row3-Col1","Row3-Col2","Row3-Col3"},;
                 {"Row4-Col1","Row4-Col2","Row4-Col3"}}

   aDat2:={{"ROW1-COL1","ROW1-COL2","ROW1-COL3"},;
                 {"ROW2-COL1","ROW2-COL2","ROW2-COL3"},;
                 {"ROW3-COL1","ROW3-COL2","ROW3-COL3"},;
                 {"ROW4-COL1","ROW4-COL2","ROW4-COL3"}}

   DEFINE DIALOG oDlg RESOURCE "Test"

   REDEFINE FOLDER oFld ;
      PROMPTS "One", "Two" ;
      DIALOGS "One", "Two" ;
      ID 100 OF oDlg

   REDEFINE XBROWSE oBrw1 ID 10 OF oFld:aDialogs[ 1 ] ARRAY aDat1 AUTOCOLS

   REDEFINE XBROWSE oBrw2 ID 10 OF oFld:aDialogs[ 2 ] ARRAY aDat2 AUTOCOLS

   oBrw1:aCols[ 2 ]:nEdittype := EDIT_BUTTON
   oBrw1:aCols[ 2 ]:bEditBlock := { || MsgYesNo( "Please select" ) }
   
   oBrw2:aCols[ 2 ]:nEdittype := EDIT_GET

   ACTIVATE DIALOG oDlg CENTERED

return nil
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests