User forums > General (but related to Code::Blocks)
Several suggestions for workspace optimization
ollydbg:
What about this logic:
--- Code: ---void CodeCompletion::UpdateToolBar()
{
ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));
bool showScope = cfg->ReadBool(_T("/scope_filter"), true);
int choice_scope_length = cfg->ReadInt(_T("/toolbar_scope_length"), 286);
int choice_function_length = cfg->ReadInt(_T("/toolbar_function_length"), 660);
if (showScope)
{
if(m_Scope)
m_Scope->SetSize(wxSize(choice_scope_length,-1));
else
{
m_Scope = new wxChoice(m_ToolBar, wxNewId(), wxPoint(0, 0), wxSize(choice_scope_length, -1), 0, 0);
m_ToolBar->InsertControl(0, m_Scope);
}
}
else
{
if(m_Scope)
{
m_ToolBar->DeleteTool(m_Scope->GetId());
m_Scope = NULL;
}
}
m_Function->SetSize(wxSize(choice_function_length,-1));
m_ToolBar->Realize();
m_ToolBar->SetInitialSize();
}
--- End code ---
MortenMacFly:
--- Quote from: ollydbg on December 22, 2011, 01:57:32 pm ---What about this logic:
--- End quote ---
Note sure where this portion did go:
--- Code: ---+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
+ m_Function->SetSize(wxSize(choice_function_length,-1));
+ m_ToolBar->Realize();
+ m_ToolBar->SetInitialSize();
--- End code ---
...but the if/then/else looks now OK. ;-)
ollydbg:
--- Quote from: MortenMacFly on December 22, 2011, 02:29:52 pm ---
--- Quote from: ollydbg on December 22, 2011, 01:57:32 pm ---What about this logic:
--- End quote ---
Note sure where this portion did go:
--- Code: ---+ m_Scope->SetSize(wxSize(choice_scope_length,-1));
+ m_Function->SetSize(wxSize(choice_function_length,-1));
+ m_ToolBar->Realize();
+ m_ToolBar->SetInitialSize();
--- End code ---
--- End quote ---
You typo "Not" -> "Note" made me think more than 5 minutes to guess your meaning. ;D
I think the code above are not needed.
MortenMacFly:
--- Quote from: ollydbg on December 23, 2011, 12:52:13 am ---You typo "Not" -> "Note" made me think more than 5 minutes to guess your meaning. ;D
--- End quote ---
Oooops. ;D
Kalith:
Nice ! I'll test it in the next nightly, thank you very much ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version