Tabs / Dialogs

Tabs / Dialogs

Postby Jeff Barnes » Sun Apr 26, 2009 4:39 pm

Hi,

I am trying to figure out how to use tab to get the same results as a folder.

I use Resource Workshop to design my screen but I cannot figure out how to show a different dialog from resource when the various tabs are selected.

Whit folders it was straight forward but I just can't get my head around these tabs.

Can someone please help me out :?

(the reason I have switched to tabs is to get a nicer looking screen)
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Tabs / Dialogs

Postby Otto » Sun Apr 26, 2009 4:49 pm

Hello Jeff,
have you seen the example in thread:
3rd party controls
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6304
Joined: Fri Oct 07, 2005 7:07 pm

Re: Tabs / Dialogs

Postby Jeff Barnes » Sun Apr 26, 2009 5:01 pm

Hi Otto,

Yes I have seen your reply ... that's what got me started.

I removed some code to get me down to just the nice looking TABS.

I have created a WINDOW with 3 tabs on it.

I can switch between the tabs and can place things in each panel via Source Code.

What I would like to do is place data in the panel using the dialog I created in resource workshop.
Basically I want the look of the TAB but with the functionality of a FOLDER.

I hope I am explaining this clearly enough :-)
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Tabs / Dialogs

Postby ukoenig » Mon Apr 27, 2009 11:18 am

Hello Jeff,

I got it working : A Folder-Simulation with Tabs from Resources without Folder-Class.

Image
Image
Image
Image

Code: Select all  Expand view

#include "FiveWin.ch"

static oWnd, oDlg, oDlg1, oDlg2, oDlg3, oDlg4, oTabs, hDC, nOldPage, nOPEN := 0

FUNCTION MAIN()

oFont := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. )

SetBalloon( .T. ) // Balloon shape required for tooltips

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


SET MESSAGE OF oWnd TO "Folder-Test" ;
CENTERED CLOCK KEYBOARD 2007

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT Test(oWnd) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 8388608, 16733011 } } , .f.)

RETURN NIL

//-----------------  TEST -----------------------------------------------------------//

FUNCTION Test(oWnd)

nStyle :=nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU,WS_MINIMIZEBOX, WS_MAXIMIZEBOX )

DEFINE DIALOG oDlg RESOURCE "MainDlg" OF oWnd STYLE nSTYLE ; //  TRANSPARENT ;
TITLE  "Folder-Test" FONT oFont

REDEFINE TABS oTabs PROMPTS "One", "Two", "Three", "Four" ID 100 OF oDlg ;
ACTION ( IIF ( oTabs:nOption = 1, FOLDER_1(), NIL ), ;
      IIF ( oTabs:nOption = 2, FOLDER_2(), NIL ), ;
      IIF ( oTabs:nOption = 3, FOLDER_3(), NIL ), ;
      IIF ( oTabs:nOption = 4, FOLDER_4(), NIL ) )

oDlg:oTop = oTabs

ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ), ;
                FOLDER_1(oDlg,oDlg1,oDlg2,oDlg3,oDlg4) ) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 16382894, 16733011 } } , .f.)

RETURN NIL  

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

FUNCTION FOLDER_1()
LOCAL oGet1
IF nOPEN = 2
   oDlg2:End()
ENDIF
IF nOPEN = 3
   oDlg3:End()
ENDIF
IF nOPEN = 4
   oDlg4:End()
ENDIF
nOPEN := 1

DEFINE DIALOG oDlg1 RESOURCE "Page1" OF oDlg TRANSPARENT

REDEFINE GET oGet1 ID 300 OF oDlg1

ACTIVATE DIALOG oDlg1 NOWAIT ;
ON INIT oDlg1:Move( 15 , 0, oDlg:nWidth, oDlg:nHeight, .f. ) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 16382894, 16733011 } } , .f.)

RETURN( NIL )

// ---------- FOLDER-PAGE 2  --------------------

FUNCTION FOLDER_2()
LOCAL oGet2
IF nOPEN = 1
   oDlg1:End()
ENDIF
IF nOPEN = 3
   oDlg3:End()
ENDIF
IF nOPEN = 4
   oDlg4:End()
ENDIF
nOPEN := 2

DEFINE DIALOG oDlg2 RESOURCE "Page2" OF oDlg TRANSPARENT

REDEFINE GET oGet2 ID 300 OF oDlg2

ACTIVATE DIALOG oDlg2 NOWAIT ;
ON INIT oDlg2:Move( 15 , 0, oDlg:nWidth, oDlg:nHeight, .f. ) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 16382894, 16733011 } } , .f.)

RETURN( NIL )

// ---------- FOLDER-PAGE 3  --------------------

FUNCTION FOLDER_3()
LOCAL oGet3
IF nOPEN = 1
   oDlg1:End()
ENDIF
IF nOPEN = 2
   oDlg2:End()
ENDIF
IF nOPEN = 4
   oDlg4:End()
ENDIF
nOPEN := 3

DEFINE DIALOG oDlg3 RESOURCE "Page3" OF oDlg TRANSPARENT

REDEFINE GET oGet3 ID 300 OF oDlg3

ACTIVATE DIALOG oDlg3 NOWAIT ;
ON INIT oDlg3:Move( 15 , 0, oDlg:nWidth, oDlg:nHeight, .f. ) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 16382894, 16733011 } } , .f.)

RETURN( NIL )

// ---------- FOLDER-PAGE 4  --------------------

FUNCTION FOLDER_4()
LOCAL oGet4
IF nOPEN = 1
   oDlg1:End()
ENDIF
IF nOPEN = 2
   oDlg2:End()
ENDIF
IF nOPEN = 3
   oDlg3:End()
ENDIF
nOPEN := 4

DEFINE DIALOG oDlg4 RESOURCE "Page4" OF oDlg TRANSPARENT

REDEFINE GET oGet4 ID 300 OF oDlg4

ACTIVATE DIALOG oDlg4 NOWAIT ;
ON INIT oDlg4:Move( 15 , 0, oDlg:nWidth, oDlg:nHeight, .f. ) ;
ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { 0.50, 16382894, 16733011 } } , .f.)

RETURN( NIL )
 


Resource

Code: Select all  Expand view

#ifdef __FLAT__
   1 24 "WindowsXP.Manifest"
#endif  

MAINDLG DIALOG 24, 52, 217, 171
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Test"
FONT 10,"MS Sans Serif"
{
 CONTROL "", 100, "TTabs", 0 | WS_CHILD | WS_VISIBLE, 0, 0, 217, 17
}

Page1 DIALOG -1, 76, 188, 158
STYLE WS_CHILD | WS_VISIBLE
FONT 10, "MS Sans Serif"
{
 EDITTEXT 300, 60, 11, 47, 12
 RTEXT "Get in Page 1", -1, 11, 13, 46, 8
}

Page2 DIALOG -1, 76, 206, 168
STYLE WS_CHILD | WS_VISIBLE
FONT 10, "MS Sans Serif"
{
 EDITTEXT 300, 101, 80, 47, 12
 RTEXT "Get in Page 2", -1, 52, 82, 46, 8
}

Page3 DIALOG -1, 76, 192, 174
STYLE WS_CHILD | WS_VISIBLE
FONT 10, "MS Sans Serif"
{
 EDITTEXT 300, 57, 145, 47, 12
 RTEXT "Get in Page 3", -1, 8, 147, 46, 8
}

Page4 DIALOG -1, 76, 191, 165
STYLE WS_CHILD | WS_VISIBLE
FONT 10, "MS Sans Serif"
{
 EDITTEXT 300, 131, 132, 47, 12
 RTEXT "Get in Page 4", -1, 82, 134, 46, 8
}

 


Regards
Uwe :shock:
Last edited by ukoenig on Fri Jul 03, 2009 5:13 pm, edited 2 times in total.
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

Re: Tabs / Dialogs

Postby Jeff Barnes » Tue Apr 28, 2009 1:16 am

Thanks Uwe.

I have been playing with this and just could not get it to do what I needed.

I am going to play around with your sample tomorrow.


Thanks again.
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 44 guests

cron