Patch #1541 2006-10-09 14:35

nix_bb

wxFlatNotebook 2.0
Download
1541-wxFlatNotebook.patch (269.0 KB)
Category
Application::Refinement
Status
Closed
Close date
2006-10-11 13:42
Assigned to
 
Index: src/CodeBlocks.cbp
===================================================================
--- src/CodeBlocks.cbp    (revision 3049)
+++ src/CodeBlocks.cbp    (working copy)
@@ -3513,6 +3513,42 @@
             <Option link="0" />
             <Option target="sdk" />
         </Unit>
+        <Unit filename="sdk\wxFlatNotebook\fnb_resources.cpp">
+            <Option compilerVar="CPP" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\popup_dlg.cpp">
+            <Option compilerVar="CPP" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\popup_dlg.h">
+            <Option compilerVar="CPP" />
+            <Option compile="0" />
+            <Option link="0" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\renderer.cpp">
+            <Option compilerVar="CPP" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\renderer.h">
+            <Option compilerVar="CPP" />
+            <Option compile="0" />
+            <Option link="0" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\singleton.h">
+            <Option compilerVar="CPP" />
+            <Option compile="0" />
+            <Option link="0" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
+        <Unit filename="sdk\wxFlatNotebook\smart_ptr.h">
+            <Option compilerVar="CPP" />
+            <Option compile="0" />
+            <Option link="0" />
+            <Option target="wxFlatNotebook" />
+        </Unit>
         <Unit filename="sdk\wxFlatNotebook\wxFNBDropTarget.h">
             <Option compilerVar="CPP" />
             <Option compile="0" />
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp    (revision 3049)
+++ src/sdk/editormanager.cpp    (working copy)
@@ -671,7 +671,7 @@
     //    LOGSTREAM << wxString::Format(_T("RemoveEditorBase(): ed=%p, title=%s\n"), eb, eb ? eb->GetFilename().c_str() : _T(""));
     int page = FindPageFromEditor(eb);
    if (page != -1 && !Manager::isappShuttingDown())
-        m_pNotebook->RemovePage(page, false);
+        m_pNotebook->RemovePage(page);

 #ifdef USE_OPENFILES_TREE
     //        if (eb->IsBuiltinEditor())
@@ -809,7 +809,7 @@
                     return false;
             wxString filename = editor->GetFilename();
             //            LOGSTREAM << wxString::Format(_T("Close(): ed=%p, title=%s\n"), editor, editor ? editor->GetTitle().c_str() : _T(""));
-            m_pNotebook->DeletePage(idx, false);
+            m_pNotebook->DeletePage(idx);
         }
     }
     m_pData->m_NeedsRefresh = true;
@@ -2736,3 +2736,4 @@
     return m_zoom;
 }

+
Index: src/sdk/wxFlatNotebook/fnb_resources.cpp
===================================================================
--- src/sdk/wxFlatNotebook/fnb_resources.cpp    (revision 0)
+++ src/sdk/wxFlatNotebook/fnb_resources.cpp    (revision 0)
@@ -0,0 +1,36 @@
+#include <stdlib.h>
+
+size_t tab_selection_png_size = 665;
+unsigned char tab_selection_png[] = {
+137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,
+0,31,243,255,97,0,0,0,43,116,69,88,116,67,114,101,97,116,105,111,110,32,
+84,105,109,101,0,83,111,32,50,51,32,70,101,98,32,50,48,48,51,32,50,49,58,
+49,54,58,49,56,32,43,48,49,48,48,249,138,209,35,0,0,0,7,116,73,77,69,7,
+211,2,23,23,43,34,85,9,241,31,0,0,0,9,112,72,89,115,0,0,11,18,0,0,11,18,
+1,210,221,126,252,0,0,0,4,103,65,77,65,0,0,177,143,11,252,97,5,0,0,1,241,
+73,68,65,84,120,218,205,146,93,72,83,113,24,198,127,103,231,28,79,219,100,
+51,231,44,22,125,24,187,8,34,210,28,4,125,32,72,31,116,19,10,65,93,134,
+87,38,120,81,215,177,139,160,91,7,101,144,208,69,17,116,149,133,72,130,
+33,102,65,84,216,72,152,125,136,133,180,173,176,114,211,181,143,179,237,
+108,231,244,223,164,66,49,161,59,223,139,255,159,247,125,159,247,225,229,
+121,94,216,112,49,117,27,45,246,236,228,131,239,51,61,75,31,39,218,147,
+145,129,218,254,245,240,182,213,133,241,52,254,184,148,232,240,170,134,
+91,93,138,110,14,133,143,95,160,43,222,205,185,72,51,109,95,148,213,120,
+105,69,214,207,145,19,173,173,119,118,53,186,119,15,14,141,115,240,209,
+89,70,246,92,179,90,218,26,217,86,39,250,63,75,57,163,172,132,71,103,185,
+196,101,41,92,25,249,195,184,247,201,206,224,249,192,225,160,167,214,46,
+135,238,61,38,17,5,87,141,9,79,71,164,55,207,11,124,240,186,173,253,1,191,
+67,245,249,142,146,40,12,210,59,23,224,122,211,194,50,193,21,154,156,41,
+35,104,232,105,91,207,141,251,228,23,139,213,221,36,75,244,156,14,176,107,
+232,168,210,203,201,40,245,190,52,218,190,3,59,10,217,236,93,209,61,85,
+213,64,41,219,186,37,7,242,232,228,123,242,63,138,203,202,228,32,149,149,
+5,139,11,52,65,162,213,136,149,156,36,117,19,51,22,23,128,186,87,149,89,
+185,242,88,237,13
download for full patch...
artoj 2006-10-10 10:49

What do the ' prefix_auto="0" extension_auto="0" ' have to do with this patch?

nix_bb 2006-10-10 17:07

Nothing at all - I'll remove it.

My apologies for any inconvinience caused.

artoj 2006-10-10 19:34

No problem, I'm just asking :)

However, I can't test this patch because TortoiseMerge gives error in line 60, "An unknown line type was found in line 60".

Also, could you explain what changes you did to the "env_settings.xrc" file?

killerbot 2006-10-11 07:27

CB adds that in cbp file !

killerbot 2006-10-11 07:32

indeed patch can't be applied, but don't worry, this patch is not usable anyway, since several changes were made on the wxFNB code by CB developers, I have made upgraded my wxFNB to 2.0 and applied to CB changes, testing that now. Then after that I will add the extra functionality you have put in.

nix_bb 2006-10-11 07:58
Sorry, I've done something horribly wrong somewhere- hope you can forgive the noob :)

Apart from the upgrade to wxFNB 2.0 my patch should only add the following to the specified files.

src/src/resources/envsettings.xrc
(add a checkbox to pblNotebooks)
+                                <object class="sizeritem">
+                                   <border>8</border>
+                                    <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
+                                    <object class="wxCheckBox" name="chkSmartTabs">
+                                        <label>Use Smart Tab-switching scheme</label>
+                                    </object>
+                                </object>


src/src/environmentsettingsdlg.cpp
     XRCCTRL(*this, "cmbEditorTabs", wxComboBox)->SetSelection(cfg->ReadInt(_T("/environment/tabs_style"), 0));
+    XRCCTRL(*this, "chkSmartTabs", wxCheckBox)->SetValue(cfg->ReadBool(_T("/environment/tabs_smart"), 0));

         cfg->Write(_T("/environment/tabs_style"),           (int)XRCCTRL(*this, "cmbEditorTabs", wxComboBox)->GetSelection());
+        cfg->Write(_T("/environment/tabs_smart"),           (bool)XRCCTRL(*this, "chkSmartTabs", wxCheckBox)->GetValue());

src/src/main.cpp
     if (cfg->ReadBool(_T("/environment/") + prefix + _T("_tabs_bottom")))
         nbstyle |= wxFNB_BOTTOM;

+    if (cfg->ReadBool(_T("/environment/tabs_smart")))
+        nbstyle |= wxFNB_SMART_TABS;
+
killerbot 2006-10-11 08:18

already done that ;-)

nix_bb 2006-10-11 08:53

That's because you're a MACHINE, no - a KILLER MACHINE! :o

Thank you for all your help, now you can delete this patch :)

-Nix

killerbot 2006-10-11 13:42

done but in a little different way

svn : 3071-3072