New tab for settings dialog

Problems compiling? Don't understand the source code? Don't know how to code your feature? Post here.

Moderator: Moderators

Xerpher
Posts: 9
Joined: 2003-06-02 14:34
Location: Canada

New tab for settings dialog

Post by Xerpher » 2003-06-05 23:54

I'm a bit confused about how to add another page of properties to the settings dialog and have been trying all day.

I added to StringDefs.cpp, PropertiesDlg.cpp, and made my own AdvPage.cpp & AdvPage.h.

Now when I try to open the settings dialog, either through the file menu or the toolbar button, just nothing happens. When I comment out my "pages[6] = new AdvPage(s);" from PropertiesDlg.cpp then the dialog opens again but of course without my new tab.

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-06-06 00:09

These are my changes to the PropertiesDialog files:

Code: Select all

--- windows\propertiesdlg.cpp   Tue Apr 15 07:58:04 2003
+++ ..\..\mine\0.251\windows\propertiesdlg.cpp   Mon May 26 20:04:50 2003
@@ -28,6 +28,7 @@
 #include "AppearancePage.h"
 #include "AdvancedPage.h"
 #include "Advanced2Page.h"
+#include "GargoyleMTPage.h"
 
 ResourceManager::Strings titles[] = {
    ResourceManager::SETTINGS_GENERAL,
@@ -35,7 +36,8 @@
    ResourceManager::SETTINGS_UPLOADS,
    ResourceManager::SETTINGS_APPEARANCE,
    ResourceManager::SETTINGS_LOGS,
-   ResourceManager::SETTINGS_ADVANCED
+   ResourceManager::SETTINGS_ADVANCED,
+    ResourceManager::SETTINGS_GARGOYLEMT
 };
 
 PropertiesDlg::PropertiesDlg(SettingsManager *s) : CPropertySheet("Settings")
@@ -46,6 +48,7 @@
    pages[3] = new AppearancePage(s);
    pages[4] = new Advanced2Page(s);
    pages[5] = new AdvancedPage(s);
+   pages[6] = new GargoyleMTPage(s);
 
    for(int i=0; i<numPages; i++) {
       pages[i]->setTitle(ResourceManager::getInstance()->getString(titles[i]));
--- windows\propertiesdlg.h   Tue Apr 15 07:58:04 2003
+++ ..\..\mine\0.251\windows\propertiesdlg.h   Sat Apr 19 23:09:55 2003
@@ -28,7 +28,7 @@
 class PropertiesDlg : public CPropertySheet
 {
 public:
-   enum { numPages = 6 };
+   enum { numPages = 7 };
 
    BEGIN_MSG_MAP(PropertiesDlg)
       COMMAND_HANDLER(IDOK, BN_CLICKED, onOK)


The rest will depend entirely on how well you copied an existing property page for use as your own.

Xerpher
Posts: 9
Joined: 2003-06-02 14:34
Location: Canada

Post by Xerpher » 2003-06-06 00:20

Oh my god, haha, thanks, I feel silly now, I forgot to change numPages in propertiesdlg.h.

Thank you GargoyleMT! :D

GargoyleMT
DC++ Contributor
Posts: 3212
Joined: 2003-01-08 02:46
Location: .pa.us

Post by GargoyleMT » 2003-06-06 00:24

It's my pleasure to be of service! :mrgreen:

Who is online

Users browsing this forum: Google [Bot] and 0 guests