tab controls im gui ändern

matriNET

Mitglied
Ich möchte die standard tabs durch sfttabs ändern, ich weis nicht wie ich das anstellen kann.

Ich möchte nicht unbedingt im sourcecode was ändern direkt im gui wenn das geht?
Ich habe versucht aber ohne erfolg , bin momentan noch dran. Es wäre am besten wenn es per drag and drop gehen würde das gibts diesen sfttabs halt nicht und den standard tabs möchte nicht mehr. kann ich den source code umgehen und direkt übers gui das alles machen?

http://www.geocities.com/daddyco2000/test.JPG
http://www.geocities.com/daddyco2000/test2.JPG

Ich habe den text aus dem sfttabs wizard rauskopiert.
Ich weis nicht ob es funktioniert brauche ich irgend welche dateien für sfttabs dll oder lib
 
Zuletzt bearbeitet:
/*------------------------------------------------------------------------------*/
/* Tabs Layout for C++/MFC - Generated by SftTabs/DLL 4.5 */
/* The following code is generated to assist you in implementing SftTabs/DLL in */
/* your application. This code should be used as an example and does need some */
/* modifications to be suitable for your application. */
/* This code can be recreated using the current .TAB file being edited. */
/*------------------------------------------------------------------------------*/

/* The following include file should be added to your */
/* application, so SftTabs/DLL definitions can be used. */
/* You can add it at the end of STDAFX.H. */

#include "SftTb.h" // SftTabs/DLL Header File

/* The following file needs to be added to your project. */
/* Or instead, it can be included ONCE in one of your */
/* source files, usually the application's main source */
/* file (containing CWinApp). */

#include "SftTbM.cpp" // SftTabs/DLL File

/* The following call to SftTabs/DLL must be made during */
/* application initialization (in CYourApp::InitInstance). */

CSftTabs::RegisterApp(); // Register with SftTabs/DLL

/* The following call to SftTabs/DLL must be made during */
/* application termination (in CYourApp::ExitInstance). */

CSftTabs::UnregisterApp(); // Unregister from SftTabs/DLL

/*------------------------------------------------------------------------------*/
/* The tab control is part of a dialog and is defined in a DIALOG resource */
/* definition. Make sure that the following window styles are defined */
/*------------------------------------------------------------------------------*/

WS_VISIBLE | WS_CHILD | // Visible, child window
WS_CLIPCHILDREN | WS_TABSTOP | WS_GROUP | // Clip child windows, tabstop, group

The window class is SftTabsControl45.
The recommended window style value is 0x52030000.

/*------------------------------------------------------------------------------*/
/* The following definitions should be placed in the parent window's class */
/* definition. */
/*------------------------------------------------------------------------------*/

CSftTabs m_Tab; // tab control

/*------------------------------------------------------------------------------*/
/* The following constants define the tab control look and layout and are used */
/* by the code below to initialize the control. */
/*------------------------------------------------------------------------------*/
 
/*- Tab Control Initialization Data --------------------------------------------*/

static const SFTTABS_CONTROL CtlInit = {
SFTTABSSTYLE_MODERN_I, /* tab style */
1, /* number of rows */
0, /* number of tabs per row (if fFixed) */
0, /* width of left margin */
0, /* width of right margin */
FALSE, /* same width for all tabs */
TRUE, /* Client area wanted */
FALSE, /* allow multiline label text */
TRUE, /* use with dialog */
FALSE, /* use specified background color only for text */
FALSE, /* scrollable tabs */
FALSE, /* hide scroll buttons */
TRUE, /* bold font for active tab wanted */
FALSE, /* fill rows completely */
NULL, /* scroll button bitmap */
NULL, /* Dialog data associated with active tab */
NULL, /* Dialog window handle associated with active tab */
NULL, /* Frame, used as client area */
TRUE, /* Tooltips wanted */
FALSE, /* drop text if it doesn't fit */
FALSE, /* conditional scroll buttons */
BMBUTTONSTYLE_STD, /* scroll button style */
TRUE, /* display ... if truncated */
TRUE, /* Flyby highlighting */
FALSE, /* use client area colors in partially obscured frames */
FALSE, /* scroll buttons on left side */
-1, /* row indentation */
FALSE, /* don't show truncated pattern for clipped tab */
FALSE, /* full size scroll buttons */
TRUE, /* use themes on Windows XP */
TRUE, /* use exact window region */
FALSE, /* always show prefix _ */
0,0,0,0, /* animation values */
NULL, /* disabled button bitmap */
TRUE, /* focus rectangle if the control has i/p focus */
};

static const SFTTABS_TAB Tab0 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};
static const SFTTABS_TAB Tab1 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};
static const SFTTABS_TAB Tab2 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};
static const SFTTABS_TAB Tab3 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};
static const SFTTABS_TAB Tab4 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};
static const SFTTABS_TAB Tab5 = { /* */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color */
SFTTABS_NOCOLOR, SFTTABS_NOCOLOR, /* background, foreground color (when selected) */
{ SFTTABS_GRAPH_NONE, 0 }, /* Bitmap, Icon */
TRUE, /* enabled/disabled */
0, /* userdata */
0, /* reserved */
NULL, /* reserved */
SFTTABS_NOCOLOR, /* Flyby foreground color */
SFTTABS_NOCOLOR, /* Client area background color */
};

/*------------------------------------------------------------------------------*/
/* This sample code can be used to initialize the tab control. */
/* This code is usually used in an OnInitDialog (WM_INITDIALOG), OnCreate */
/* (WM_CREATE) or OnInitialUpdate member function of the tab control's parent */
/* dialog or window. */
/*------------------------------------------------------------------------------*/

int index;

/* Associate the tab control created from the dialog */
/* resource with the C++ object. */
m_Tab.SubclassDlgItem(IDC_TAB, this /* parent window */);

/* You could use DDX/DDV instead and add the following */
/* line to the DoDataExchange function of the tab */
/* control's parent window (remove the //). */
// DDX_Control(pDX, IDC_TAB, m_Tab);

/* Initialization is faster if we set redraw off */
m_Tab.SetRedraw(FALSE);

/* We are using new features */
m_Tab.SetVersion(SFTTABS_4_5);

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 0"));
m_Tab.SetTabInfo(index, &Tab0);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 1"));
m_Tab.SetTabInfo(index, &Tab1);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 2"));
m_Tab.SetTabInfo(index, &Tab2);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 3"));
m_Tab.SetTabInfo(index, &Tab3);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 4"));
m_Tab.SetTabInfo(index, &Tab4);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

index = m_Tab.AddTab(_T(""));
m_Tab.SetToolTip(index, _T("ToolTip for tab number 5"));
m_Tab.SetTabInfo(index, &Tab5);
// If you don't want to attach a page to the tab, the following is optional
// m_Tab.SetTabDialog(index, new an_object_based_on_CSftTabsPage(this)); // tab page

m_Tab.SetControlInfo(&CtlInit);

// Make sure to turn redraw back on
m_Tab.SetRedraw(TRUE);
m_Tab.InvalidateRect(NULL, TRUE);

// If you are not using the sheet/page classes, remove the call to InitializeTabControl.
// Initialize tab control. Instead you have to make one of the tabs active using SetCurrentTab.
InitializeTabControl(0, &m_Tab, NULL);
// return FALSE; if this is a dialog's OnInitDialog member function

/*------------------------------------------------------------------------------*/
/* Page Implementation */
/*------------------------------------------------------------------------------*/

// Individual pages are implemented by creating a dialog with a dialog
// resource. You can create each page as an object derived from CSftTabsPage
// (which is derived from CDialog).

// Once you have created the dialog resource, you can use ClassWizard to generate
// the implementation of the page object by deriving its new class from
// CDialog. Because your object is really derived from CSftTabsPage,
// you have to manually edit all references to CDialog and change
// them to CSftTabsPage.

// When using ClassWizard to add new functions to this new class, make sure to
// change any reference to CDialog to use CSftTabsPage instead.
 
matriNET: Dein Post ist unübersichtlich Quadrat. Pack doch grosse Source-Schnipsel in eine Code-Box (wie steht in der FAQ).

Was du möchtest (statt Standardtabs im Studio-Editor diese SFT-Tabs verwenden) ist mit normal nachgestellten Controls nicht möglich, es sei denn, sie wären ActiveX/OCX/wieauchimmerdasheisst-fähig. Soweit ich das aus den Kommentaren da lese, musst du aber sowieso im Sourcecode rumarbeiten. Also im Editor normale Tabs erstellen und dann im jeweiligen Dialog deine SFT-Tabs da einsetzen (da stand was von Subclass), vermutlich im OnInitDialog des Dialoges.

In den Kommentarblöcken steht auch eigentlich alles drin, was wo hin muss.
 
Zuletzt bearbeitet:
Zurück