Author Topic: 3 simple thoughts  (Read 23031 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: 3 simple thoughts
« Reply #15 on: November 29, 2006, 03:59:33 pm »
wxFNB does support a drop-down list of tabs as a replacement for the navigation arrows. How difficult would it be to make that an option?

Depends on killerbot's mood and free time :).
He 's the one that worked with wxFNB recently so, if he wanted (hint, hint ;)), he could add this feature...
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: 3 simple thoughts
« Reply #16 on: November 29, 2006, 05:29:40 pm »
wxFNB does support a drop-down list of tabs as a replacement for the navigation arrows. How difficult would it be to make that an option?

Depends on killerbot's mood and free time :).
He 's the one that worked with wxFNB recently so, if he wanted (hint, hint ;)), he could add this feature...

ok, I will implement this, but the earliest might be this weekend. It will have to be an option since not everyone likes it like that !!!

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: 3 simple thoughts
« Reply #17 on: November 29, 2006, 05:55:40 pm »
wxFNB does support a drop-down list of tabs as a replacement for the navigation arrows. How difficult would it be to make that an option?

Depends on killerbot's mood and free time :).
He 's the one that worked with wxFNB recently so, if he wanted (hint, hint ;)), he could add this feature...

ok, I will implement this, but the earliest might be this weekend. It will have to be an option since not everyone likes it like that !!!

That sounds fantastic!
Thanks!
:mrgreen:

sethjackson

  • Guest
Re: 3 simple thoughts
« Reply #18 on: November 29, 2006, 07:18:25 pm »
Ok here is the patch, but there is a nasty side affect. :P

Code
Index: src/src/environmentsettingsdlg.cpp
===================================================================
--- src/src/environmentsettingsdlg.cpp (revision 3309)
+++ src/src/environmentsettingsdlg.cpp (working copy)
@@ -157,6 +157,7 @@
     // tab "Notebook"
     XRCCTRL(*this, "cmbEditorTabs", wxComboBox)->SetSelection(cfg->ReadInt(_T("/environment/tabs_style"), 0));
     XRCCTRL(*this, "chkSmartTabs", wxCheckBox)->SetValue(cfg->ReadBool(_T("/environment/tabs_smart"), 0));
+    XRCCTRL(*this, "chkListTabs", wxCheckBox)->SetValue(cfg->ReadBool(_T("/environment/tabs_list"), 0));
     XRCCTRL(*this, "btnFNBorder", wxButton)->SetBackgroundColour(cfg->ReadColour(_T("/environment/gradient_border"), wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))));
     XRCCTRL(*this, "btnFNFrom", wxButton)->SetBackgroundColour(cfg->ReadColour(_T("/environment/gradient_from"), wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))));
     XRCCTRL(*this, "btnFNTo", wxButton)->SetBackgroundColour(cfg->ReadColour(_T("/environment/gradient_to"), *wxWHITE));
@@ -382,6 +383,7 @@
         // tab "Appearence"
         cfg->Write(_T("/environment/tabs_style"),           (int)XRCCTRL(*this, "cmbEditorTabs", wxComboBox)->GetSelection());
         cfg->Write(_T("/environment/tabs_smart"),           (bool)XRCCTRL(*this, "chkSmartTabs", wxCheckBox)->GetValue());
+        cfg->Write(_T("/environment/tabs_list"),           (bool)XRCCTRL(*this, "chkListTabs", wxCheckBox)->GetValue());
         cfg->Write(_T("/environment/gradient_border"),      XRCCTRL(*this, "btnFNBorder", wxButton)->GetBackgroundColour());
         cfg->Write(_T("/environment/gradient_from"),        XRCCTRL(*this, "btnFNFrom", wxButton)->GetBackgroundColour());
         cfg->Write(_T("/environment/gradient_to"),          XRCCTRL(*this, "btnFNTo", wxButton)->GetBackgroundColour());
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 3309)
+++ src/src/main.cpp (working copy)
@@ -1457,13 +1457,21 @@
             nbstyle = 0;
             break;
     }
+
     nbstyle |= defaultStyle;
+
     if (cfg->ReadBool(_T("/environment/") + prefix + _T("_tabs_bottom")))
         nbstyle |= wxFNB_BOTTOM;
 
     if (cfg->ReadBool(_T("/environment/tabs_smart")))
         nbstyle |= wxFNB_SMART_TABS;
 
+    if (cfg->ReadBool(_T("/environment/tabs_list")))
+    {
+        nbstyle |= wxFNB_DROPDOWN_TABS_LIST;
+        nbstyle |= wxFNB_NO_NAV_BUTTONS;
+    }
+
     target->SetWindowStyleFlag(nbstyle);
     target->SetGradientColorBorder(cfg->ReadColour(_T("/environment/gradient_border"), wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW))));
     target->SetGradientColorFrom(cfg->ReadColour(_T("/environment/gradient_from"), wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE))));
Index: src/src/resources/env_settings.xrc
===================================================================
--- src/src/resources/env_settings.xrc (revision 3309)
+++ src/src/resources/env_settings.xrc (working copy)
@@ -439,6 +439,13 @@
                     <label>Use Smart Tab-switching scheme</label>
                   </object>
                 </object>
+                <object class="sizeritem">
+                  <border>8</border>
+                  <flag>wxALL|wxALIGN_LEFT|wxALIGN_TOP</flag>
+                  <object class="wxCheckBox" name="chkListTabs">
+                    <label>Use drop-down tab list</label>
+                  </object>
+                </object>
               </object>
             </object>
           </object>
@@ -658,4 +665,4 @@
       </object>
     </object>
   </object>
-</resource>
\ No newline at end of file
+</resource>


Now to the screenshots....


« Last Edit: November 29, 2006, 08:39:24 pm by sethjackson »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: 3 simple thoughts
« Reply #19 on: November 29, 2006, 08:29:25 pm »
Seth, could you edit/repost those images so they enlarge when clicked?
 I can't see what your talking about.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: 3 simple thoughts
« Reply #21 on: November 29, 2006, 08:43:40 pm »
The drop-down arrow is not drawn correctly if the wxFNB_NO_X_BUTTON style is used.

I looked at the source, and it seems that the same bitmap (m_xBgBmp) is used to draw the background for both the drop-down arrow and the x button, and if the x button is not drawn, then the background bitmap is not initialized correctly, thus the background is all black. (I think, eran will know for sure).

sethjackson

  • Guest
Re: 3 simple thoughts
« Reply #22 on: November 29, 2006, 08:46:56 pm »
So it is a bug in wxFNB?

Offline rjmyst3

  • Multiple posting newcomer
  • *
  • Posts: 117
    • wxFormBuilder
Re: 3 simple thoughts
« Reply #23 on: November 29, 2006, 09:01:02 pm »
yes, it is a bug in wxFNB

here is a patch to fix it:
Code
Index: renderer.cpp
===================================================================
--- renderer.cpp (revision 3)
+++ renderer.cpp (working copy)
@@ -205,7 +205,7 @@
  xbmp.SetMask(new wxMask(xbmp, MASK_COLOR));
  // erase old bitmap
  int posx = GetDropArrowButtonPos( pc );
- dc.DrawBitmap(m_xBgBmp, posx, 6);
+ dc.DrawBitmap(m_rightBgBmp, posx, 6);
 
  // Draw the new bitmap
  dc.DrawBitmap(xbmp, posx, 6, true);

Offline Belgabor

  • Multiple posting newcomer
  • *
  • Posts: 91
Re: 3 simple thoughts
« Reply #24 on: November 29, 2006, 10:25:38 pm »
While we're collecting things for eran to fix/add, why not add a rightclick menu to the arrows like Firefox 2 has?
(For those who don't know, Firefox 2 shows a list of the tabs hidden in the respective direction if you right-click an arrow)

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: 3 simple thoughts
« Reply #25 on: November 29, 2006, 11:13:22 pm »
Quote
(For those who don't know, Firefox 2 shows a list of the tabs hidden in the respective direction if you right-click an arrow)
If
If I understand you correctly, this is doable with wxFNB as well, instead of the <> arrows, you can choose to use a drop down button '\/' which will popup a menu with all hidden tabs.

I am not sure if C::B team as added this as an option, but it does exist.

Eran

« Last Edit: November 29, 2006, 11:15:02 pm by eranif »

Offline Belgabor

  • Multiple posting newcomer
  • *
  • Posts: 91
Re: 3 simple thoughts
« Reply #26 on: November 30, 2006, 04:12:21 am »
Quote
(For those who don't know, Firefox 2 shows a list of the tabs hidden in the respective direction if you right-click an arrow)
If
If I understand you correctly, this is doable with wxFNB as well, instead of the <> arrows, you can choose to use a drop down button '\/' which will popup a menu with all hidden tabs.

I am not sure if C::B team as added this as an option, but it does exist.


Yep, that was suggested earlier in this thread. The difference to Firefox 2 is that the right click on the arrows there shows only the tabs hidden in that direction, not all tabs, and you can still use the arrows, so it gives the best of both worlds :)
It's not terribly important, but as a matter of fact I got so used to it in Firefox that I find myself right-clicking on the arrows in C::B more and more often :p

thomas.gilray

  • Guest
Re: 3 simple thoughts
« Reply #27 on: November 30, 2006, 08:44:54 am »
Where is the development subject as specified in C::B DEVELOPMENT STRICTLY ??

Oh, sorry if i put this in the wrong forum...

I thought that general was more about using CB while this topic is about what could be added, changed, fixed in CB...

Seems relevant to me but if not, sorry.

thomas.gilray

  • Guest
Re: 3 simple thoughts
« Reply #28 on: November 30, 2006, 11:09:55 am »
wxFNB does support a drop-down list of tabs as a replacement for the navigation arrows. How difficult would it be to make that an option?

Depends on killerbot's mood and free time :).
He 's the one that worked with wxFNB recently so, if he wanted (hint, hint ;)), he could add this feature...

ok, I will implement this, but the earliest might be this weekend. It will have to be an option since not everyone likes it like that !!!

That sounds fantastic!
Thanks!
:mrgreen:

Yeah, That'd Be awsome!

sethjackson

  • Guest
Re: 3 simple thoughts
« Reply #29 on: November 30, 2006, 06:28:06 pm »
<snipped>

Yeah, That'd Be awsome!

Already in. Killerbot applied my patch, and rjmyst3's. ;)