where should I upload / publish my patches to codeblocks?
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.
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:
--- 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;
--- 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...
Quote from: mikejonesey on February 27, 2011, 05:15:08 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:
Quote from: mikejonesey on February 27, 2011, 05:15:08 PM
2nd patch:
Good one... I'll think about it...
Quote from: MortenMacFly on February 27, 2011, 05:21:38 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).
QuoteI don't understand the cursor movement... This works very well!
The arrow keys did not work at all on my system (ubuntu 10.10)...
QuoteFinally: 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...
Quote from: jens on February 27, 2011, 07:01:42 PM
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?