FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour search for TTabControl() Sample
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
search for TTabControl() Sample
Posted: Fri Oct 28, 2022 07:17 AM
hi,

i´m searching for TAB Sample and found TTabControl() and TTabs()
for TTabControl () i found
c:\fwh\samples\testtctr.prg
but Sample is limited to 10 lines ... :(

---

as i remember SysTabControl is "just" Control for "Tabs" but have "no Body"
in FiveWin Sample i can "see" a white Area so i guess "something" have add

but how to "use Body" as Parent to put a Control on it :?:

---

i try to use oTabs as Parent but got Error
Called from: ../../../tobject.prg => TTABCONTROL:ADIALOGS( 0 )
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW_GOTFOCUS( 3018 )
but there is not ADIALOGS in CLASS TTabControl() ... hm :?

who can help me and show me a (working) Sample

.p.s. i do not want to use CLASS TTabs()
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Fri Oct 28, 2022 12:11 PM
here a Sample which crash TTABCONTROL:ADIALOGS
Code (fw): Select all Collapse
#include "FiveWin.ch"
MEMVAR oMain, oExplorer, oStatusBar, lImage, oTabs

PROCEDURE Main()
LOCAL oFont
LOCAL nHeight   := 1024
LOCAL nWidth    := 1280
LOCAL nTop      := 0
LOCAL nLeft     := 0
LOCAL nIcoLarge := 256
LOCAL nIcoSmall := 32
LOCAL cLog      := cFileSetExt( ExeName(), "LOG" )

PRIVATE oMain
PRIVATE oExplorer
PRIVATE oStatusBar
PRIVATE oTabs

   DEFINE WINDOW oMain FROM  0,0 TO nWidth, nHeight PIXEL TITLE "FiveWin TGrid Listview Demo " ICON "A1MAIN"

      oTabs = TTabControl():New( nTop, nLeft, , , oMain, , , , .T., .F., nWidth-20, nHeight-20, )
      oTabs:bAction = {|| EVAL(&("DoProc"+AllTrim( Str( oTabs:nOption ) )+"()" )) }

      oTabs:Add( "Grid_1 " )
      oTabs:Add( "Grid_2 " )
      oTabs:Add( "Grid_3 " )

      DEFINE STATUSBAR oStatusBar PROMPT "Hello World " OF oMain SIZES nWidth - 100 CLOCK

#IFDEF __HMG__
      END STATUSBAR
   END WINDOW
#ENDIF

  ACTIVATE WINDOW oMain CENTER

RETURN

PROCEDURE DoProc1()
   MsgInfo("switch 1")
RETURN

PROCEDURE DoProc2()
   MsgInfo("switch 2")
RETURN

PROCEDURE DoProc3()
   MsgInfo("switch 3")
RETURN
it does show MsgInfo() and than crash :(
Error description: Error BASE/1004 Message not found: TTABCONTROL:ADIALOGS
Args:
[ 1] = O TTABCONTROL

Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TTABCONTROL:ERROR( 0 )
Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
Called from: ../../../tobject.prg => TTABCONTROL:MSGNOTFOUND( 0 )
Called from: ../../../tobject.prg => TTABCONTROL:ADIALOGS( 0 )
Called from: .\source\classes\WINDOW.PRG => (b)TWINDOW_GOTFOCUS( 3018 )
Called from: => AEVAL( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:GOTFOCUS( 3018 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3681 )
Called from: => MSGINFO( 0 )
Called from: TCONTROL.prg => DOPROC2( 60 )
Called from: TCONTROL.prg => (b)MAIN( 23 )
Called from: .\source\classes\TTABCTRL.PRG => TTABCONTROL:NOTIFY( 165 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:NOTIFY( 1612 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3681 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1114 )
Called from: TCONTROL.prg => MAIN( 51 )
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: search for TTabControl() Sample
Posted: Fri Oct 28, 2022 07:53 PM

Dear Jimmy,

I guess that you are talking about folders. In FWH you have the class TFolder

Search for TFolder in FWH\samples

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Fri Oct 28, 2022 11:46 PM
hi Antonio,
Antonio Linares wrote:I guess that you are talking about folders. In FWH you have the class TFolder
thx for Hint using CLASS TFolder()

i have look into Sample Textfx3.PRG but don´t understand how it work.
i can "see" some Controls on "Body" but where is the CODE for it :?

---

Sample Textfx4.PRG "seems" to show what i miss "aDialogs"
Code (fw): Select all Collapse
  oFld:aDialogs[ 2 ]
so i will try that

---

Question : what is TTABCONTROL() for when not used under FiveWin :?:
greeting,

Jimmy
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 05:59 AM
hi Antonio,

have some (small) Problem with TFolder()

when i assign {} as 3rd Parameter (aPrompts) of TFolder() and use AddItem() than Control will not appear :?
Code (fw): Select all Collapse
   oTabs := TFolder():New( 0, 0,{} , , oMain, 1, , , .t.,;
                          .f., oMain:nRight - oMain:nLeft, oMain:nBottom - oMain:nTop )
   oTabs:AddItem("Grid_1")

   @ 20, 10 BUTTON oBtn PROMPT "blabla" SIZE 300,200 OF oTabs:aDialogs[ 1 ] PIXEL ACTION MsgInfo("blabla")
...

when add more Tab
Code (fw): Select all Collapse
   oTabs:AddItem("Grid_2")
Button on oTabs:aDialogs[ 1 ] appear

---

when "fill" 3rd Parameter {"Test"} and NOT use AddItem() it work and Button appear

is this a BUG :?:
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 07:30 AM

Dear Jimmy,

Please provide a complete PRG to test it, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 07:47 AM
try this
Code (fw): Select all Collapse
#include "FiveWin.ch"
MEMVAR oMain, oTabs, oStatusBar

PROCEDURE Main()
LOCAL oFont
LOCAL nHeight   := 1024
LOCAL nWidth    := 1280
LOCAL nTop      := 0
LOCAL nLeft     := 0
LOCAL oBtn

PRIVATE oMain, oTabs, oStatusBar

   DEFINE WINDOW oMain FROM  0,0 TO nWidth, nHeight PIXEL TITLE "FiveWin TGrid Listview Demo "

* #define working
#IFDEF working
   oTabs := TFolder():New( 3, 3,{"no_1"} , , oMain, 1, , , .t.,;
                          .f., oMain:nRight - oMain:nLeft, oMain:nBottom - oMain:nTop )
#ELSE
   oTabs := TFolder():New( 3, 3,{} , , oMain, 1, , , .t.,;
                          .f., oMain:nRight - oMain:nLeft, oMain:nBottom - oMain:nTop )
   oTabs:AddItem("Grid_1")
*  oTabs:AddItem("Grid_2")
#ENDIF

   oTabs:SetOption( 1 )

   @ 20, 10 BUTTON oBtn PROMPT "blabla" SIZE 300,200 OF oTabs:aDialogs[ 1 ] PIXEL ACTION MsgInfo("blabla")

      DEFINE STATUSBAR oStatusBar PROMPT "Hello World " OF oMain SIZES nWidth - 100 CLOCK

   ACTIVATE WINDOW oMain CENTER

RETURN
greeting,

Jimmy
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 08:31 AM
This works fine here:
Code (fw): Select all Collapse
#include "FiveWin.ch"

PROCEDURE Main()
LOCAL nHeight   := 1024
LOCAL nWidth    := 1280

PRIVATE oMain, oTabs, oStatusBar

   DEFINE WINDOW oMain FROM  0,0 TO nWidth, nHeight PIXEL TITLE "FiveWin TGrid Listview Demo "

* #define working
#ifdef working
   oTabs := TFolder():New( 3, 3,{"no_1"} , , oMain, 1, , , .t.,;
                          .f., oMain:nRight - oMain:nLeft, oMain:nBottom - oMain:nTop )
#else
   oTabs := TFolder():New( 3, 3,{} , , oMain, 1, , , .t.,;
                          .f., oMain:nRight - oMain:nLeft, oMain:nBottom - oMain:nTop )
   oTabs:AddItem("Grid_1")
   oTabs:AddItem("Grid_2")
#endif

   oTabs:SetOption( 1 )

   @ 20, 10 BUTTON "blabla" SIZE 300,200 OF oTabs:aDialogs[ 1 ] PIXEL ACTION MsgInfo("blabla")
   @ 20, 10 BUTTON "blabla2" SIZE 300,200 OF oTabs:aDialogs[ 2 ] PIXEL ACTION MsgInfo("blabla2")

      DEFINE STATUSBAR oStatusBar PROMPT "Hello World " OF oMain SIZES nWidth - 100 CLOCK

   ACTIVATE WINDOW oMain CENTER

RETURN
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 08:46 AM
hi Enrico,
Enrico Maria Giordano wrote:This works fine here:
did you see a big Button and got MsgInfo() when click on it :?:
greeting,

Jimmy
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 08:51 AM

Yes, on both tabs.

Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 10:00 AM
hi Enrico,
Enrico Maria Giordano wrote:Yes, on both tabs.
should be only 1 x TAB , as provide Original, which does not work
greeting,

Jimmy
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 10:29 AM

I don't understand. Can you describe the problem clearly and show a sample reproducing it, please?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 10:29 AM
Dear Jimmy,

This is the right way to do it:
Code (fw): Select all Collapse
#include "FiveWin.ch"
MEMVAR oMain, oTabs, oStatusBar

PROCEDURE Main()
LOCAL oFont
LOCAL nHeight   := 400
LOCAL nWidth    := 300
LOCAL nTop      := 0
LOCAL nLeft     := 0
LOCAL oBtn

PRIVATE oMain, oTabs, oStatusBar

   DEFINE WINDOW oMain FROM 0, 0 TO nWidth, nHeight PIXEL TITLE "FiveWin TGrid Listview Demo "

   @ 0, 0 FOLDER oTabs PROMPTS "no_1" OF oMain 

   oMain:oClient = oTabs

   @ 20, 10 BUTTON oBtn PROMPT "blabla" SIZE 80, 20 OF oTabs:aDialogs[ 1 ] PIXEL ACTION MsgInfo( "blabla" )

   DEFINE STATUSBAR oStatusBar PROMPT "Hello World " OF oMain SIZES nWidth - 100 CLOCK

   ACTIVATE WINDOW oMain CENTER

RETURN
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 04:13 PM
Jimmy,

This post has also a sample with Folders. Maybe usefull

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=41175&hilit=+folder
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: search for TTabControl() Sample
Posted: Sat Oct 29, 2022 05:25 PM

FWH class TFolder and TPages are created from Windows TTabControl32, with extended functionality.

TFolder class is very widely used and we should find many examples if we look around.

TFolderEx is totally FWH own control and does not depend on any Windows control.

TTabs control also is an FWH own control.

Regards



G. N. Rao.

Hyderabad, India