search for TTabControl() Sample

search for TTabControl() Sample

Postby Jimmy » Fri Oct 28, 2022 7: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Jimmy » Fri Oct 28, 2022 12:11 pm

here a Sample which crash TTABCONTROL:ADIALOGS
Code: Select all  Expand view
#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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Antonio Linares » Fri Oct 28, 2022 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: search for TTabControl() Sample

Postby Jimmy » 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: Select all  Expand view
 oFld:aDialogs[ 2 ]

so i will try that

---

Question : what is TTABCONTROL() for when not used under FiveWin :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Jimmy » Sat Oct 29, 2022 5: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: Select all  Expand view
  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: Select all  Expand view
  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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Antonio Linares » Sat Oct 29, 2022 7:30 am

Dear Jimmy,

Please provide a complete PRG to test it, thanks
regards, saludos

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

Re: search for TTabControl() Sample

Postby Jimmy » Sat Oct 29, 2022 7:47 am

try this
Code: Select all  Expand view
#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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Enrico Maria Giordano » Sat Oct 29, 2022 8:31 am

This works fine here:

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: search for TTabControl() Sample

Postby Jimmy » Sat Oct 29, 2022 8: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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Re: search for TTabControl() Sample

Postby Jimmy » 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
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: search for TTabControl() Sample

Postby Enrico Maria Giordano » Sat Oct 29, 2022 10:29 am

I don't understand. Can you describe the problem clearly and show a sample reproducing it, please?
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: search for TTabControl() Sample

Postby Antonio Linares » Sat Oct 29, 2022 10:29 am

Dear Jimmy,

This is the right way to do it:
Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42065
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: search for TTabControl() Sample

Postby Marc Venken » Sat Oct 29, 2022 4:13 pm

Jimmy,

This post has also a sample with Folders. Maybe usefull

viewtopic.php?f=3&t=41175&hilit=+folder
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1425
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: search for TTabControl() Sample

Postby nageswaragunupudi » Sat Oct 29, 2022 5: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
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], wilsongamboa and 47 guests