Page 1 of 1

Help with tfolderex

Posted: Fri Jan 04, 2013 12:51 am
by Eroni
Good night, someone uses the folderex add item at run time? Add the item ok, but no way to set the icon, below the sample code, changed in the samples folder.

#include "FiveWin.ch"

static oWnd,oFld

function main()
local i
local aBitmaps := { "..\bitmaps\alphabmp\exit.bmp", "..\bitmaps\alphabmp\exit.bmp" }
local oGet
local cGet := space(10)

DEFINE WINDOW oWnd TITLE "TFolderex - Testing -" MENU _BuildMenu()

@ 3, 3 FOLDEREX oFld PIXEL ADJUST;
PROMPT "Option 1", "Option 2";//
BITMAPS aBitmaps;
ACTION( ::HideTab( nOption ) );
TOP ALIGN FLDBMP_RIGHT, FLDBMP_RIGHT


@ 5,5 GET oGet var cGet OF oFld:aDialogs[ 1 ]

FOR i = 1 TO Len( oFld:aPrompts )
oFld:SetBrightBmp( "..\bitmaps\alphabmp\exit2.bmp", i )
NEXT

ACTIVATE WINDOW oWnd

RETURN NIL

function _BuildMenu()
local oMenu

MENU oMenu // does not work?
MENUITEM "New" ACTION Buildnew() ,oFld:SetBitmap( "..\bitmaps\alphabmp\exit.bmp" ) )
ENDMENU

Return( oMenu )

function BuildNew()
local oGet
local cGet := Space(10)

oFld:AddItem( "New tab" )
@ 5,5 GET oGet var cGet OF oFld:aDialogs[ Len(oFld:aDialogs ) ]
Return( NIL )

Re: Help with tfolderex

Posted: Fri Jan 04, 2013 6:00 pm
by ukoenig
Eroni,

try this
( the new bitmap is defined in the Bmp-array ( 3 ) )
aBitmaps := { c_path1 + "additem.bmp", c_path1 + "additem.bmp", c_path1 + "additem.bmp" }

Image

Your sample :

Code: Select all

#include "FiveWin.ch"

static oWnd,oFld, c_path1

function main()
local i
local aBitmaps
local oGet
local cGet := space(10)

DEFINE WINDOW oWnd TITLE "TFolderex - Testing -" MENU _BuildMenu() 

c_path := cFilePath(GetModuleFileName( GetInstance() ) ) 
c_path1 := c_path + "SYSTEM\" 
aBitmaps := { c_path1 + "additem.bmp", c_path1 + "additem.bmp", c_path1 + "additem.bmp"  }

@ 3, 3 FOLDEREX oFld PIXEL ADJUST;
PROMPT "Option 1", "Option 2";// 
BITMAPS aBitmaps;
ACTION( ::HideTab( nOption ) );
TOP ALIGN FLDBMP_RIGHT, FLDBMP_RIGHT

@ 5,5 GET oGet var cGet OF oFld:aDialogs[ 1 ]

FOR i = 1 TO Len( oFld:aPrompts )
    oFld:SetBrightBmp( c_path1 + "additem.bmp", i ) 
NEXT

ACTIVATE WINDOW oWnd

RETURN NIL

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

function _BuildMenu()
local oMenu

MENU oMenu // does not work?
MENUITEM "New" ACTION  Buildnew()
ENDMENU

Return( oMenu )

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

function BuildNew()
local oGet
local cGet := Space(10)

oFld:AddItem( "New tab" )
oFld:SetBrightBmp( oFld:aBitmaps[Len(oFld:aDialogs)], Len(oFld:aDialogs ) )
oFld:aAlign[Len(oFld:aDialogs)] := 1

@ 5,5 GET oGet var cGet OF oFld:aDialogs[ Len(oFld:aDialogs ) ] 

Return( NIL )
Best Regards
Uwe :lol:

Re: Help with tfolderex

Posted: Fri Jan 04, 2013 6:51 pm
by Eroni
Uwe, Ok, I did not want to leave the preset amount of tabs, but thats ok, I will create an array with a maximum number possible, thanks for the tip.
It would be possible to navigate folderex like the screen below?
Image
Many thanks!

Re: Help with tfolderex

Posted: Fri Jan 04, 2013 8:10 pm
by Daniel Garcia-Gil
Hello

folderex have not this feature, you can use a multiline

Re: Help with tfolderex

Posted: Fri Jan 04, 2013 8:48 pm
by ukoenig
You can change from TFolderEx to TFolder to use this Tabs.

Image

@ 3, 3 FOLDEREX oFld OF oWnd PIXEL SIZE 280,220 ;
PROMPT "Option 1", "Option 2";//
BITMAPS aBitmaps;
ACTION( ::HideTab( nOption ) );
TOP ALIGN FLDBMP_RIGHT, FLDBMP_RIGHT

@ 5,5 GET oGet var cGet OF oFld:aDialogs[ 1 ]

FOR i = 1 TO Len( oFld:aPrompts )
oFld:SetBrightBmp( c_path1 + "additem.bmp", i )
NEXT

@ 3, 300 FOLDER oFld1 PROMPT "&xBase", "&And OOP", "&Power", "Page 4", "Page 5" ;
OF oWnd PIXEL SIZE 160, 150

Best Regards
Uwe :lol:

Re: Help with tfolderex

Posted: Mon Jan 07, 2013 5:42 pm
by Eroni
Uwe, Daniel, many thanks.

Eroni