NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include <util/checksum.hpp>
#include <gui/utils/string_utils.hpp>
#include <gui/widgets/wx/wx_utils.hpp>
#include <gui/widgets/wx/sys_path.hpp>
#include <gui/widgets/wx/fileartprov.hpp>
#include <gui/widgets/wx/text_report_dlg.hpp>
#include <gui/utils/menu_item.hpp>
#include <gui/utils/rgba_color.hpp>
#include <connect/ncbi_conn_test.hpp>
#include <corelib/ncbiexec.hpp>
#include <corelib/ncbi_system.hpp>
#include <corelib/ncbifile.hpp>
#include <wx/app.h>
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/colordlg.h>
#include <wx/dc.h>
#include <wx/listctrl.h>
#include <wx/frame.h>
#include <wx/filename.h>
#include <wx/renderer.h>
#include <wx/dcmemory.h>
#include <wx/imaglist.h>
#include <wx/display.h>
#include <Winnetwk.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
wxString | FindExeFile (const wxString &exeFile) |
void | ReportIDError (const string &id_label, bool is_local, const string &title) |
void | ReportMemoryUsage () |
void | OpenFileBrowser (const wxString &path) |
wxString | GetAbsolutePath (const wxString &localpath) |
string | GetMD5Digest (const CChecksum &cs) |
string | GetVideoId () |
Returns id of video configuration to be used for saving settings. More... | |
wxString | FnToWxString (const string &s) |
string | FnToStdString (const wxString &s) |
wxString | ToRelativePath (const wxString &base, const wxString &abs_path) |
converts an absolute path to a relative one based on current workspace directory More... | |
wxString | ToAbsolutePath (const wxString &base, const wxString &rel_path) |
converts relative path from the current workspace directory to an absolute path More... | |
void | InitDefaultFileArtProvider (const wxString &dir) |
wxFileArtProvider * | GetDefaultFileArtProvider () |
void | FromArrayString (const wxArrayString &in, vector< string > &out) |
void | ToArrayString (const vector< string > &in, wxArrayString &out) |
wxMenu * | CreateMenu (const CMenuItem *item) |
Creates a wxMenu object replicating the structure of CMenuItem. More... | |
wxMenuItem * | FindSubItem (wxMenu &menu, const wxString &text) |
Find a subitem of the given menu by text. More... | |
static wxMenuItemList::const_iterator | s_FindSeparator (wxMenu &menu, const wxString &text) |
static wxMenuItemList::const_iterator | s_FindSubItem (wxMenuItemList::const_iterator begin, wxMenuItemList::const_iterator end, const wxString &text, bool skip_named_groups) |
static void | s_InsertInUnnamedGroup (wxMenu &menu, wxMenuItem &item) |
static wxString | s_GetCleanMenuText (const wxMenuItem &item) |
static wxMenuItem * | s_CloneMenuItem (wxMenu &menu, const wxMenuItem &item) |
wxMenu * | CloneMenu (const wxMenu &menu) |
create a copy of the given menu More... | |
void | Merge (wxMenu &menu_1, const wxMenu &menu_2) |
This function merges the content of menu_2 into menu_1 based on equivalence of item labels Menu trees are merged based on item's labels. More... | |
void | CleanupSeparators (wxMenu &menu) |
Removes extra separators (in the begining or at the end of the menu, ot those that precede other separators) More... | |
void | UseDefaultMarginWidth (wxMenu &menu) |
Using default menu item margin width. More... | |
void | SetMenuItemMarginWidth (wxMenuItem *item, wxBitmap *bmp) |
Set margin width for menu item. More... | |
string | ToString (const wxRect &rc) |
wxRect | GetScreenRect (const wxWindow &win) |
void | WindowSetText (const wxWindow &win, const wxChar *text) |
Windows specific function, equivalent of SetWindowText() WinAPI. More... | |
static unsigned char | s_Average (unsigned char c1, unsigned char c2, double ratio) |
wxColour | GetAverage (const wxColor &c1, const wxColor &c2, double ratio) |
int | TruncTextLength (wxDC &dc, const wxString &s, int w, Ewx_Truncate trunc) |
returns number of characters representing a truncated version of "s" which fits in the gievn width "w" "trunc" controls truncation, if "trunc" == eTruncate_Ellipsis "..." is appended to the end of the truncated string. More... | |
wxString | TruncateText (wxDC &dc, const wxString &s, int w, Ewx_Truncate trunc) |
truncates given string so that its length is less or equal "w" "trunc" controls truncation, if "trunc" == eTruncate_Ellipsis "..." is appended to the end of the truncated string. More... | |
void | WrapText (wxDC &dc, const string &text, int w, vector< int > &line_lens) |
divides given "text" into lines, so that every line has width less or equal to "w". More... | |
wxColour | ConvertColor (const CRgbaColor &c2) |
CRgbaColor | ConvertColor (const wxColour &c) |
void | SaveWindowRectToRegistry (const wxRect &rc, CRegistryWriteView view) |
void | LoadWindowRectFromRegistry (wxRect &rc, const CRegistryReadView &view) |
void | CorrectWindowRect (wxTopLevelWindow *win, wxRect &rc) |
bool | NcbiChooseColor (wxWindow *parent, CRgbaColor &color) |
wxWindow * | FindChildWindowById (long id, wxWindow *parent) |
void | BroadcastCommandToChildWindows (wxWindow *window, int cmd_id, int cmd_data) |
Sends command event with id 'cmd_id' to window and all its children. More... | |
void | AddChildWindowAbove (wxFrame *parent, wxWindow *child) |
For OSX Cocoa, puts child window in front of (visually) parent. More... | |
void | AddChildWindowBelow (wxFrame *parent, wxWindow *child) |
For OSX Cocoa, puts child window behind the parent. More... | |
void | RemoveChildWindow (wxFrame *parent, wxWindow *child) |
For OSX Cocoa, removes child window connection (for layering) to parent. More... | |
void | GetMacDragWindowBounds (wxTopLevelWindow *win, int &menubar_height, int &maxy, int &maxx) |
Returns window boundaries for mac (top menubar width and max height) More... | |
bool | GetMacOptionKeyDown () |
For mac, return an ID for the current space (of "Spaces" fame) More... | |
bool | DlgGLWinOverlayFix (wxWindow *win) |
Fix a problem on windows where after a dialog overlays an opengl window the opengl window may be constrained to just the area under the dialog until some window-changing event. More... | |
wxSize | GetDisplayPPI () |
Mac always seems to return 72 for screen PPI so use wx function for non-mac and on mac divide the displays number of pixels by its physical size to get actual PPI. More... | |
bool | RunningInsideNCBI () |
wxImageList * | CreateCheckboxImages (wxWindow *wnd) |
Variables | |
wxFileArtProvider * | s_FileArtProvider = NULL |
bool | sf_FileArtProviderPushed = false |
void AddChildWindowAbove | ( | wxFrame * | parent, |
wxWindow * | child | ||
) |
For OSX Cocoa, puts child window in front of (visually) parent.
Definition at line 1194 of file wx_utils.cpp.
References NULL.
Referenced by CTooltipFrame::AddChildWindow(), CSequenceGotoDlg::Show(), and CwxMarkerInfoDlg::Show().
void AddChildWindowBelow | ( | wxFrame * | parent, |
wxWindow * | child | ||
) |
For OSX Cocoa, puts child window behind the parent.
Definition at line 1209 of file wx_utils.cpp.
References NULL.
Sends command event with id 'cmd_id' to window and all its children.
Definition at line 1145 of file wx_utils.cpp.
References ITERATE.
Referenced by CWorkbenchFrame::OnActivate(), CDockManager::OnEndDrag(), CWorkbenchFrame::OnMove(), CDockManager::OnMove(), CFloatingFrame::OnMovingEvent(), CDockNotebook::OnPageChanged(), and CDockManager::x_MoveToFloatingFrame().
void CleanupSeparators | ( | wxMenu & | menu | ) |
Removes extra separators (in the begining or at the end of the menu, ot those that precede other separators)
Definition at line 668 of file wx_utils.cpp.
Referenced by CwxTableListCtrl::OnContextMenu(), CSelectionViewEventHandler::OnContextMenu(), CDataMiningPanel::OnContextMenu(), CProjectTreePanel::OnContextMenu(), CDiagConsoleList::OnContextMenu(), CEventTablePanel::OnContextMenu(), CTaskTablePanel::OnContextMenu(), CTextItemPanel::OnContextMenu(), CSelectionPanel::OnContextMenu(), CFlatFileViewContext::OnEditBioseq(), CGridWidget::OnGridCellRightClick(), CMenuService::ResetMenuBar(), and CGlWidgetBase::x_ShowDecoratedPopupMenu().
wxMenu* CloneMenu | ( | const wxMenu & | menu | ) |
create a copy of the given menu
Definition at line 559 of file wx_utils.cpp.
References ITERATE, and s_CloneMenuItem().
Referenced by CWindowManagerService::GetMenu(), CMenuService::ResetMenuBar(), and s_CloneMenuItem().
wxColour ConvertColor | ( | const CRgbaColor & | c2 | ) |
Definition at line 997 of file wx_utils.cpp.
References CRgbaColor::GetAlphaUC(), CRgbaColor::GetBlueUC(), CRgbaColor::GetGreenUC(), and CRgbaColor::GetRedUC().
Referenced by CColorPanel::ContrastBG(), CColorPanel::ContrastFG(), CColorTableScoringPanel::Init(), CColorTableScoringPanel::OnApply(), CwxHistogramDlg::OnColourpickerctrl1ColourPickerChanged(), CGradientPanel::OnPaint(), CClockPanelWMClient::SetColor(), CwxScoreDlg::TransferDataFromWindow(), CwxScoreDlg::TransferDataToWindow(), and CwxHistogramDlg::x_SelectGraph().
CRgbaColor ConvertColor | ( | const wxColour & | c | ) |
Definition at line 1003 of file wx_utils.cpp.
void CorrectWindowRect | ( | wxTopLevelWindow * | win, |
wxRect & | rc | ||
) |
Definition at line 1026 of file wx_utils.cpp.
References GetMacDragWindowBounds(), and i.
Referenced by CDialog::LoadSettings(), CMainFrame::LoadSettings(), CEditingBtnsPanel::LoadSettings(), CSequenceEditingEventHandler::LoadSettings(), and CDialog::x_CorrectDisplay().
wxImageList* CreateCheckboxImages | ( | wxWindow * | wnd | ) |
Definition at line 1352 of file wx_utils.cpp.
Referenced by wxCheckedListCtrl::Create(), and CTrackListCtrl::CTrackListCtrl().
Creates a wxMenu object replicating the structure of CMenuItem.
Definition at line 365 of file wx_utils.cpp.
References _ASSERT, bmp, CMenuItem::eItem, CMenuItem::eSeparator, CMenuItem::GetCommand(), CMenuItem::GetImageAlias(), CMenuItem::GetLabel(), CMenuItem::GetTooltip(), CMenuItem::GetType(), CMenuItem::IsCheckType(), CMenuItem::IsRadioType(), CMenuItem::IsSubmenu(), NULL, SetMenuItemMarginWidth(), CMenuItem::SubItemsBegin(), CMenuItem::SubItemsEnd(), ToWxString(), and wxID_ANY.
Referenced by CGraphOverlay::LH_OnItemRightClick(), and CAlnMultiWidget::x_CreateScoringMethodsMenu().
bool DlgGLWinOverlayFix | ( | wxWindow * | win | ) |
Fix a problem on windows where after a dialog overlays an opengl window the opengl window may be constrained to just the area under the dialog until some window-changing event.
Problem only occurs if Aero theme is Not being used.
Definition at line 1290 of file wx_utils.cpp.
Referenced by CGlWidgetPane::DlgOverlayFix(), and IQueryWidget::DlgOverlayFix().
wxWindow* FindChildWindowById | ( | long | id, |
wxWindow * | parent | ||
) |
Definition at line 1130 of file wx_utils.cpp.
wxString FindExeFile | ( | const wxString & | exeFile | ) |
Definition at line 76 of file wx_utils.cpp.
References wxT.
Referenced by CClustalOmegaToolParams::GetClustalOmegaExecutable(), CClustalwToolParams::GetClustalWExecutable(), CKalignToolParams::GetKalignExecutable(), CMafftToolParams::GetMafftExecutable(), CMuscleToolParams::GetMuscleExecutable(), CBamIndexingPanel::GetSamtoolsPath(), CBamIndexingPanel::IsInputValid(), and CExeFileValidator::Validate().
wxMenuItem* FindSubItem | ( | wxMenu & | menu, |
const wxString & | text | ||
) |
Find a subitem of the given menu by text.
Definition at line 426 of file wx_utils.cpp.
References ITERATE, NULL, and text().
Referenced by CAlnMultiWidget::x_CreatePopupMenu(), and CWindowManager::x_UpdateWindowsMenu().
Definition at line 268 of file wx_utils.cpp.
References CStringUtil::base64Encode(), and string.
Referenced by CAlignTabExportParams::LoadSettings(), CPhyExportParams::LoadSettings(), CAgpExportParams::LoadSettings(), CFastaExportParams::LoadSettings(), CFlatFileExportParams::LoadSettings(), CGffExportParams::LoadSettings(), CGtfExportParams::LoadSettings(), CAgpLoadParams::LoadSettings(), C5ColExporter::LoadSettings(), CGenBankUIDataSource::Open(), CProjectService::SaveSettings(), CFileLoadManager::SaveSettings(), CAlignTabExportParams::SaveSettings(), CClustalOmegaToolParams::SaveSettings(), CClustalwToolParams::SaveSettings(), CPhyExportParams::SaveSettings(), CAgpExportParams::SaveSettings(), CFastaExportParams::SaveSettings(), CFlatFileExportParams::SaveSettings(), CGffExportParams::SaveSettings(), CGtfExportParams::SaveSettings(), CAgpLoadParams::SaveSettings(), C5ColExporter::SaveSettings(), CFileLoadMRUList::SaveToStrings(), CGBDocument::SetFileName(), CwxCSVExportDlg::x_LoadSettings(), CProjectLoadingTask::x_OnWakeUp(), CProjectTask::x_OpenProjects(), and CwxCSVExportDlg::x_SaveSettings().
Definition at line 253 of file wx_utils.cpp.
References CStringUtil::base64Decode().
Referenced by CGBDocument::GetFileName(), CFileLoadMRUList::LoadFromStrings(), CProjectService::LoadSettings(), CFileLoadManager::LoadSettings(), CAlignTabExportParams::LoadSettings(), CClustalOmegaToolParams::LoadSettings(), CClustalwToolParams::LoadSettings(), CPhyExportParams::LoadSettings(), CAgpExportParams::LoadSettings(), CFastaExportParams::LoadSettings(), CFlatFileExportParams::LoadSettings(), CGffExportParams::LoadSettings(), CGtfExportParams::LoadSettings(), CAgpLoadParams::LoadSettings(), C5ColExporter::LoadSettings(), CGenBankUIDataSource::Open(), CProjectService::SaveWorkspace(), and CwxCSVExportDlg::x_LoadSettings().
Definition at line 343 of file wx_utils.cpp.
References i, in(), n, out(), and ToStdString().
Referenced by CMacroEditorContext::GetFeatQualifiers(), NcbiFileBrowser(), and CFrameworkDemoGUIDropTarget::OnData().
wxString GetAbsolutePath | ( | const wxString & | localpath | ) |
Definition at line 188 of file wx_utils.cpp.
References buffer, CDirEntry::CreateAbsolutePath(), eFollowLinks, CDirEntry::NormalizePath(), and result.
Referenced by CTableReaderMacro::CreateMacros(), CMacroPanelLoader::OnButtonClicked(), CFileLocDialog::OnOpenFile(), CMacroApplySrcTablePanel::OnOpenFile(), CMacroUpdProteinPanel::OnOpenFile(), CMacroWordSubstitutionDlg::OnOpenFile(), CMacroAdvStringConstraintPanel< T >::OnOpenFile(), CMacroFlowEditor::OpenSynonymFile(), and CEditMacroDlg::OpenSynonymFile().
Definition at line 810 of file wx_utils.cpp.
References a, b, g(), r(), and s_Average().
Referenced by CStatusBar::GetBackColor(), PT::CDataLoader::Initialize(), PT::CProjectItem::Initialize(), CGroupMapWidget::CGroupItem::x_DrawBackground(), CMapControl::x_DrawSeparationLines(), CMapItem::x_DrawSeparator(), and CMapControl::x_Init().
wxFileArtProvider* GetDefaultFileArtProvider | ( | ) |
Definition at line 334 of file wx_utils.cpp.
References NULL, and s_FileArtProvider.
Referenced by CBamUIDataSourceType::CBamUIDataSourceType(), CEditToolbar::CEditToolbar(), CErrorListCtrl::CErrorListCtrl(), CGenBankUIDataSourceType::CGenBankUIDataSourceType(), CGroupMapWidget::CGroupMapWidget(), CLBLASTUIDataSourceType::CLBLASTUIDataSourceType(), PT::CPTIcons::CPTIcons(), CIndProgressBar::Create(), CAlignMultipleDemoDlg::CreateControls(), CTableDataListCtrl::CTableDataListCtrl(), CTableImportListCtrl::CTableImportListCtrl(), CTooltipFrame::CTooltipFrame(), CwxTreeCtrlEx::CwxTreeCtrlEx(), CDataMiningPanel::Init(), CDiagConsolePanel::Init(), CEventTablePanel::Init(), CQueryParsePanel::Init(), CSelectionPanel::Init(), CCrossAlnDemoDlg::Init(), CPhyloTreeDemoDlg::Init(), CConfigureTracksDlg::Init(), CSeqGraphicDemoDlg::Init(), CSeqTextDemoDlg::Init(), InitDefaultFileArtProvider(), CWindowManagerService::InitService(), CTooltipFrame::OnPinButton(), CPhyloTreeWidget::x_CreateControls(), CWorkbench::x_CreateFileArtProvider(), CTextPanel::x_CreateMainToolbar(), CSeqDesktopPanel::x_CreateToolbar(), CGraphicPanel::x_CreateToolbar(), and CDockMarkerWindow::x_InitBitmaps().
wxSize GetDisplayPPI | ( | ) |
Mac always seems to return 72 for screen PPI so use wx function for non-mac and on mac divide the displays number of pixels by its physical size to get actual PPI.
Definition at line 1309 of file wx_utils.cpp.
Referenced by CTextPanel::GetFont().
void GetMacDragWindowBounds | ( | wxTopLevelWindow * | win, |
int & | menubar_height, | ||
int & | maxy, | ||
int & | maxx | ||
) |
Returns window boundaries for mac (top menubar width and max height)
Definition at line 1239 of file wx_utils.cpp.
References int, NULL, and r().
Referenced by CorrectWindowRect(), CWorkbenchFrame::OnIdle(), and CDockManager::x_MoveDragFrame().
bool GetMacOptionKeyDown | ( | ) |
For mac, return an ID for the current space (of "Spaces" fame)
Definition at line 1274 of file wx_utils.cpp.
Definition at line 211 of file wx_utils.cpp.
References buf, CChecksum::GetMD5Digest(), i, and result.
Referenced by GetVideoId(), s_GetMD5Tag(), and CQueryParsePanel::SetDataSource().
wxRect GetScreenRect | ( | const wxWindow & | win | ) |
Definition at line 783 of file wx_utils.cpp.
Referenced by CDockManager::AddToDefaultLocation(), CAsyncCallDlg::Create(), CTooltipFrame::FitToWindow(), CDockContainer::OnDragOver(), IMovableButton::onMouseClick(), IMovableButton::OnRightClick(), CSeqGraphicPane::OnSearchTip(), CAECRFrame::SaveSettings(), CBulkEditFeatDlg::SaveSettings(), CEditPubDlg::SaveSettings(), CFindASN1Dlg::SaveSettings(), CParseTextDlg::SaveSettings(), CValidateFrame::SaveSettings(), CEditSequence::SaveSettings(), CMacroFlowEditor::SaveSettings(), CEditingBtnsPanel::SaveSettings(), CMacroEditor::SetPositionAndSize(), CMacroFlowEditor::SetPositionAndSize(), CDockContainer::x_CalculateHintRect(), CDockManager::x_GetActiveContainerByPos(), CDockManager::x_MoveToFloatingFrame(), CMessageSlot::x_ShowPopup(), CwxTableListCtrl::x_ShowTooltip(), and CMacroEditor::~CMacroEditor().
string GetVideoId | ( | ) |
Returns id of video configuration to be used for saving settings.
Definition at line 224 of file wx_utils.cpp.
References _TRACE, CChecksum::AddLine(), CChecksum::eMD5, GetMD5Digest(), i, NStr::Int8ToString(), and str().
Referenced by CDockManager::ApplyLayout(), CWndLayoutReg::GetLayout(), CWndLayoutReg::GetReadView(), CWndLayoutReg::GetWriteView(), CWndLayoutReg::Reset(), CDockManager::SaveLayout(), and CWndLayoutReg::SetLayout().
void InitDefaultFileArtProvider | ( | const wxString & | dir | ) |
Definition at line 323 of file wx_utils.cpp.
References wxFileArtProvider::AddDirectory(), GetDefaultFileArtProvider(), and sf_FileArtProviderPushed.
Referenced by CWorkbench::x_CreateFileArtProvider().
void LoadWindowRectFromRegistry | ( | wxRect & | rc, |
const CRegistryReadView & | view | ||
) |
Definition at line 1018 of file wx_utils.cpp.
References CRegistryReadView::GetInt().
Referenced by CDialog::LoadSettings(), and CMainFrame::LoadSettings().
void Merge | ( | wxMenu & | menu_1, |
const wxMenu & | menu_2 | ||
) |
This function merges the content of menu_2 into menu_1 based on equivalence of item labels Menu trees are merged based on item's labels.
merges all items form menu_2 into menu_1, preserving the structure if possible
Labels specify unique path to an item (similarly to paths in file systems).
Definition at line 579 of file wx_utils.cpp.
References _ASSERT, ITERATE, label, s_CloneMenuItem(), s_FindSeparator(), s_FindSubItem(), s_GetCleanMenuText(), and s_InsertInUnnamedGroup().
Referenced by CRegExFSA::Add(), AddCommandsForScopedObjects(), SPSG_UserArgsBuilder::Build(), CFlatFileViewContext::CreateMenu(), CDesktopViewContext::CreateMenu(), CWindowManager::GetMenu(), CSelectionViewEventHandler::OnContextMenu(), CDataMiningPanel::OnContextMenu(), CProjectTreePanel::OnContextMenu(), CEventTablePanel::OnContextMenu(), CTaskTablePanel::OnContextMenu(), CTextItemPanel::OnContextMenu(), CFlatFileViewContext::OnEditBioseq(), CGridWidget::OnGridCellRightClick(), CMenuService::ResetMenuBar(), CSeqGraphicWidget::x_CreatePopupMenu(), and SPSG_UserArgsBuilder::x_UpdateCache().
bool NcbiChooseColor | ( | wxWindow * | parent, |
CRgbaColor & | color | ||
) |
Definition at line 1114 of file wx_utils.cpp.
Referenced by CWindowManager::OnSetClientColor().
void OpenFileBrowser | ( | const wxString & | path | ) |
Definition at line 129 of file wx_utils.cpp.
References CExec::eNoWait, file, and CExec::SpawnLP().
Referenced by CMacroFlowEditor::RunScriptStandalone(), and CAppExportTask::x_Finish().
void RemoveChildWindow | ( | wxFrame * | parent, |
wxWindow * | child | ||
) |
For OSX Cocoa, removes child window connection (for layering) to parent.
Definition at line 1224 of file wx_utils.cpp.
References NULL.
Referenced by CTooltipFrame::RemoveChildWindow(), CSequenceGotoDlg::Show(), and CwxMarkerInfoDlg::Show().
Definition at line 99 of file wx_utils.cpp.
References NULL, CTextReportDlg::SetText(), str(), ToWxString(), and wxID_ANY.
Referenced by CDesktopDataBuilder::CDesktopDataBuilder(), CSeqTextPanel::InitObject(), CViewGraphic::InitView(), and CVcfTableView::InitView().
void ReportMemoryUsage | ( | ) |
Definition at line 116 of file wx_utils.cpp.
References CCurrentProcess::GetMemoryUsage(), Info(), LOG_POST, and usage.
bool RunningInsideNCBI | ( | ) |
Definition at line 1335 of file wx_utils.cpp.
References CConnTest::IsNcbiInhouseClient(), CSysPath::ResolvePathExisting(), and wxT.
Referenced by CClickableSortUniqueCount::CClickableSortUniqueCount(), CDiscrepancyDlg::Create(), CAECRFrame::CreateControls(), CDiscrepancyDlg::CreateControls(), CDiscrepancyPanel::CreateControls(), CValidateFrame::CreateControls(), CValidatePanel::CreateControls(), CEditSequence::CreateControls(), CRawSeqToDeltaByNPanel::CreateControls(), CUpdateSeqPanel::CreateControls(), CValidatorReportCfgDlg::CreateControls(), CTextViewOptionsDlg::CreateControls(), CUICommandRegistry::CreateMenu(), CUpdateSeqPanel::GetData(), CSequenceEditingEventHandler::GetFeatureLocation(), CAlignPackage::Init(), CSeqEditPackage::Init(), CDescriptorTextPanel::IsExportEnabled(), CLocationPanel::IsExportEnabled(), CStructuredCommentPanel::IsExportEnabled(), CDescriptorTextPanel::IsImportEnabled(), CLocationPanel::IsImportEnabled(), CStructuredCommentPanel::IsImportEnabled(), CSequenceEditingEventHandler::IsLocationSelected(), CAECRFrame::LoadSettings(), CEditingBtnsPanel::LoadSettings(), CDiscrepancyDlg::OnDataChanged(), CDiscrepancyPanel::OnDblClk(), CUpdateSeqPanel::OnIgnoreAlignmentClick(), CUpdateSeqPanel::OnImportChecked(), CValidatePanel::OnListItemRightClick(), CValidatePanel::OnListItemSelected(), CValidatePanel::OnMouseMove(), CUpdateSeqPanel::OnReplaceBtnSelected(), CUpdateSeq_Dlg::OnUpdateSequence(), CDiscrepancyPanel::RefreshData(), CAECRFrame::SaveSettings(), CUpdateSeqPanel::SetData(), CAECRFrame::SetInitParameters(), CFlatFileViewContext::ShowEditIcons(), CUpdateSeqPanel::UpdatePanel(), CSrcDescEditorPanel::UpdateSeqdesc(), CSequenceEditingEventHandler::UpdateSingleSequence(), CValidatePanel::x_DisplayList(), CTableDataValidateJob::x_FetchAll(), and CUpdateSeqPanel::x_InitAlnMultiWidgetAndUpdateTypes().
|
static |
Definition at line 803 of file wx_utils.cpp.
Referenced by GetAverage().
Definition at line 521 of file wx_utils.cpp.
References CloneMenu(), NULL, s_GetCleanMenuText(), and SetMenuItemMarginWidth().
Referenced by CloneMenu(), and Merge().
Definition at line 505 of file wx_utils.cpp.
References i.
Referenced by Merge(), and s_CloneMenuItem().
|
static |
void SaveWindowRectToRegistry | ( | const wxRect & | rc, |
CRegistryWriteView | view | ||
) |
Definition at line 1009 of file wx_utils.cpp.
References CRegistryWriteView::Set().
Referenced by CDialog::SaveSettings(), and CMainFrame::SaveSettings().
void SetMenuItemMarginWidth | ( | wxMenuItem * | item, |
wxBitmap * | bmp | ||
) |
Set margin width for menu item.
Definition at line 709 of file wx_utils.cpp.
References bmp.
Referenced by CUICommand::AppendMenuItem(), CreateMenu(), and s_CloneMenuItem().
converts relative path from the current workspace directory to an absolute path
Definition at line 301 of file wx_utils.cpp.
References wxT.
Definition at line 353 of file wx_utils.cpp.
References i, in(), n, out(), and ToWxString().
Referenced by CApplyIndexerComments::CreateControls(), CGeneralIDPanel::CreateControls(), CSingleChoicePanel::CreateControls(), CMacroFeatsOnSeqPanel::CreateControls(), CBLASTSearchParamsPanel::x_InitGeneticCodesCombo(), CSingleQualPanel::x_LoadChoices(), and CBLASTSearchOptionsPanel::x_OnInputTypeChanged().
converts an absolute path to a relative one based on current workspace directory
Definition at line 281 of file wx_utils.cpp.
References wxT.
Definition at line 773 of file wx_utils.cpp.
References NStr::IntToString().
Referenced by CSampleEditSaver::CommitTransaction(), SCmdCreator< type >::CreateCmd(), IBISAnnotateDialog::IBISAnnotateDialog(), CGencollIdMapper::SIdSpec::operator string(), CWidgetDisplayStyle::SaveSettings(), WriteContainer(), and WriteMap().
wxString TruncateText | ( | wxDC & | dc, |
const wxString & | s, | ||
int | w, | ||
Ewx_Truncate | trunc = ewxTruncate_Ellipsis |
||
) |
truncates given string so that its length is less or equal "w" "trunc" controls truncation, if "trunc" == eTruncate_Ellipsis "..." is appended to the end of the truncated string.
Definition at line 878 of file wx_utils.cpp.
References ewxTruncate_Ellipsis, ewxTruncate_EllipsisAlways, int, len, n, trunc, TruncTextLength(), and wxT.
Referenced by CMessageSlot::OnPaint(), CSelectionBroadcastSlot::OnPaint(), CMapItem::x_CalculateRealTextWidth(), CDockPanel::x_DrawClientElements(), CMinPanelContainer::x_DrawItem(), and CMapItem::x_DrawText().
int TruncTextLength | ( | wxDC & | dc, |
const wxString & | s, | ||
int | w, | ||
Ewx_Truncate | trunc = ewxTruncate_Ellipsis |
||
) |
returns number of characters representing a truncated version of "s" which fits in the gievn width "w" "trunc" controls truncation, if "trunc" == eTruncate_Ellipsis "..." is appended to the end of the truncated string.
Definition at line 820 of file wx_utils.cpp.
References ewxTruncate_Ellipsis, ewxTruncate_EllipsisAlways, ewxTruncate_Empty, int, len, min(), n, trunc, and wxT.
Referenced by TruncateText(), and WrapText().
void UseDefaultMarginWidth | ( | wxMenu & | menu | ) |
Using default menu item margin width.
The is a work-around for a wxWidget bug on failing to reset to default margin width after using any user-owned bitmap image in menu item. The failure will cause the default radio menu item bitmap image disappear.
Definition at line 693 of file wx_utils.cpp.
References wxT.
Referenced by CUICommand::AppendMenuItem(), CFeaturePanel::x_OnColorIconClicked(), CFeatureTrack::x_OnContentIconClicked(), CSixFramesTransTrack::x_OnContentIconClicked(), CFeaturePanel::x_OnDecorationIconClicked(), CSixFramesTransTrack::x_OnGeneticIconClicked(), CSnpTrack::x_OnIconClicked(), CFeaturePanel::x_OnLabelIconClicked(), CAlignmentTrack::x_OnLayoutIconClicked(), CFeaturePanel::x_OnLayoutIconClicked(), CFeatureTrack::x_OnLayoutIconClicked(), CGeneModelTrack::x_OnLayoutIconClicked(), CAlignmentTrack::x_OnScoreIconClicked(), CSixFramesTransTrack::x_OnSettingIconClicked(), CEpigenomicsTrack::x_OnSettingsIconClicked(), CGraphTrack::x_OnSettingsIconClicked(), CTraceGraphTrack::x_OnSettingsIconClicked(), CFeaturePanel::x_OnSizeIconClicked(), and CAlignmentTrack::x_OnTailsIconClicked().
Windows specific function, equivalent of SetWindowText() WinAPI.
Definition at line 794 of file wx_utils.cpp.
References text().
Referenced by CTaskTablePanel::CreateControls().
divides given "text" into lines, so that every line has width less or equal to "w".
Returns length of lines in "line_lens".
Definition at line 895 of file wx_utils.cpp.
References ewxTruncate_Empty, int, text(), ToWxString(), and TruncTextLength().
Referenced by CMapItem::x_CalculateRealTextWidth(), CMapItem::x_DrawText(), and CMapItem::x_PreferredLabelHeight().
wxFileArtProvider* s_FileArtProvider = NULL |
Definition at line 320 of file wx_utils.cpp.
Referenced by GetDefaultFileArtProvider().
Definition at line 321 of file wx_utils.cpp.
Referenced by InitDefaultFileArtProvider().