Author Topic: re: where to upload / publish my c:b patches  (Read 6853 times)

Offline mikejonesey

  • Single posting newcomer
  • *
  • Posts: 7
re: where to upload / publish my c:b patches
« on: February 27, 2011, 03:18:38 pm »
where should I upload / publish my patches to codeblocks?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: re: where to upload / publish my c:b patches
« Reply #1 on: February 27, 2011, 03:34:37 pm »
If there are bug fixes I suggest the standard place
http://developer.berlios.de/patch/?group_id=5358

Note: if they are short you could post them in this thread.
If long attach them and post description in this or another thread.
But, if no one applies them in 2 weeks; I would post them on Berlios C::B site.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline mikejonesey

  • Single posting newcomer
  • *
  • Posts: 7
Re: re: where to upload / publish my c:b patches
« Reply #2 on: February 27, 2011, 05:15:08 pm »
ok well they're not bug fixes; just little "annoying things", for some reason you can't navigate the project manager via keyboard;

1st patch:
Code
--- src/sdk/projectmanager_old.cpp	2011-02-27 13:36:32.000766001 +0000
+++ src/sdk/projectmanager.cpp 2011-02-27 15:55:00.000000000 +0000
@@ -141,12 +141,86 @@
                 wxPostEvent(GetParent(), e);
             }
             else
+            {
                 event.Skip();
+            }
+        }
+        void OnKeyDown(wxKeyEvent& event)
+        {
+ wxString key;
+ long keycode = event.GetKeyCode();
+ switch ( keycode )
+ {
+ case WXK_UP: key = _T("UP"); break;
+ case WXK_DOWN: key = _T("DOWN"); break;
+ case WXK_LEFT: key = _T("LEFT"); break;
+ case WXK_RIGHT: key = _T("RIGHT"); break;
+ case WXK_RETURN: key = _T("ENTER"); break;
+ }
+ wxTreeItemId itemId = this->GetSelection();
+ if((key) && (key==_("UP")) && (itemId.IsOk()))
+ {
+ //GetPrevVisible - not implemented... strange...
+ wxTreeItemId itemIdb = this->GetPrevSibling(itemId);
+ if(itemIdb.IsOk())
+ {
+ this->SelectItem(itemIdb, true);
+ }
+ else
+ {
+ wxTreeItemId itemIdb = this->GetItemParent(itemId);
+ if(itemIdb.IsOk())
+ this->SelectItem(itemIdb, true);
+ }
+ }
+ else if((key) && (key==_("DOWN")) && (itemId.IsOk()))
+ {
+ wxTreeItemId tmpId = this->GetNextVisible(itemId);
+ if(tmpId.IsOk())
+ this->SelectItem(tmpId, true);
+ }
+ else if((key) && (key==_("LEFT")) && (itemId.IsOk()))
+ {
+ if((this->ItemHasChildren(itemId))&&(this->IsExpanded(itemId)))
+ {
+ this->Collapse(itemId);
+ }
+ else
+ {
+ wxTreeItemId itemIdb = this->GetItemParent(itemId);
+ if(itemIdb.IsOk())
+ this->SelectItem(itemIdb, true);
+ }
+ }
+ else if((key) && (key==_("RIGHT")) && (itemId.IsOk()))
+ {
+ if((this->ItemHasChildren(itemId)) && (!this->IsExpanded(itemId)))
+ {
+ this->Expand(itemId);
+ }
+ else
+ {
+ wxTreeItemIdValue cookieMonsta;
+ wxTreeItemId itemIdb = this->GetFirstChild(itemId, cookieMonsta);
+ if(itemIdb.IsOk())
+ this->SelectItem(itemIdb, true);
+ }
+ }
+ else if((key) && (key==_("ENTER")) && (itemId.IsOk()))
+ {
+ wxTreeEvent myevent = wxTreeEvent(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, this, itemId);
+ wxPostEvent(this, myevent);
+ }
+ else
+ {
+ event.Skip();
+ }
         }
         DECLARE_EVENT_TABLE();
 };
 BEGIN_EVENT_TABLE(PrjTree, wxTreeCtrl)
     EVT_RIGHT_DOWN(PrjTree::OnRightClick)
+    EVT_KEY_DOWN(PrjTree::OnKeyDown)
 END_EVENT_TABLE()
 #endif // !__WXMSW__
 

also when you close all editors it's nice for the project tree to gain focus so you can key to the next file to edit;

2nd patch;
Code
--- src/sdk/cbeditor_old.cpp	2011-02-27 15:57:43.000000000 +0000
+++ src/sdk/cbeditor.cpp 2011-02-27 15:52:45.000000000 +0000
@@ -758,6 +758,11 @@
     DestroySplitView();
 
     delete m_pData;
+    size_t editorCount = Manager::Get()->GetEditorManager()->GetNotebook()->GetPageCount();
+    if(editorCount<1)
+    {
+        Manager::Get()->GetProjectManager()->GetTree()->SetFocus();
+    }
 }
 
 void cbEditor::DoInitializations(const wxString& filename, LoaderBase* fileLdr)

If I have pasted in the wrong place please let me know;

these are simple patched but make an essential difference for me;

cheers...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: re: where to upload / publish my c:b patches
« Reply #3 on: February 27, 2011, 05:21:38 pm »
1st patch:
While I like the idea with the "Enter" key (in fact that's a limitation I experienced myself) I don't understand the cursor movement... This works very well! Under what circumstances does it not work?

Finally: Why don't you replace all occurrences of "(key) && (key==_("UP"))" with "(keycode == WXK_UP)"? That would be a way better style instead comparing strings... :shock:

2nd patch:
Good one... I'll think about it...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: re: where to upload / publish my c:b patches
« Reply #4 on: February 27, 2011, 07:01:42 pm »
[...] I don't understand the cursor movement... This works very well! Under what circumstances does it not work?

Does not work in linux (most likely a limitation of the wxWidgets implememtation).

Offline mikejonesey

  • Single posting newcomer
  • *
  • Posts: 7
Re: re: where to upload / publish my c:b patches
« Reply #5 on: February 27, 2011, 07:12:17 pm »
Quote
I don't understand the cursor movement... This works very well!
The arrow keys did not work at all on my system (ubuntu 10.10)...

Quote
Finally: Why don't you replace all occurrences of "(key) && (key==_("UP"))" with "(keycode == WXK_UP)"?
yea, copy n paste from another of my projects which has a treeview... can be switched...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: re: where to upload / publish my c:b patches
« Reply #6 on: February 28, 2011, 07:38:02 am »
Does not work in linux (most likely a limitation of the wxWidgets implememtation).
How weird is that?! :shock: In fact - I never noticed.

But then we should make the cursor related modification for Linux (WXGTK?!) only. Which platform(s) would have this issue? What about Mac?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ