#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.
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...For OSX Cocoa, puts child window behind the parent.
Definition at line 1209 of file wx_utils.cpp.
References NULL.
◆ BroadcastCommandToChildWindows() void BroadcastCommandToChildWindows ( wxWindow * window, int cmd_id, int cmd_data ) ◆ CleanupSeparators() 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().
◆ CloneMenu() wxMenu* CloneMenu ( const wxMenu & menu ) ◆ ConvertColor() [1/2]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().
◆ ConvertColor() [2/2] ◆ CorrectWindowRect() void CorrectWindowRect ( wxTopLevelWindow * win, wxRect & rc ) ◆ CreateCheckboxImages() wxImageList* CreateCheckboxImages ( wxWindow * wnd ) ◆ CreateMenu()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().
◆ DlgGLWinOverlayFix() bool DlgGLWinOverlayFix ( wxWindow * win ) ◆ FindChildWindowById() wxWindow* FindChildWindowById ( long id, wxWindow * parent ) ◆ FindExeFile() wxString FindExeFile ( const wxString & exeFile ) ◆ FindSubItem() wxMenuItem* FindSubItem ( wxMenu & menu, const wxString & text ) ◆ FnToStdString()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().
◆ FnToWxString()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().
◆ FromArrayString() void FromArrayString ( const wxArrayString & in, vector< string > & out ) ◆ GetAbsolutePath() 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().
◆ GetAverage() wxColour GetAverage ( const wxColor & c1, const wxColor & c2, double ratio )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().
◆ 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().
◆ 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().
◆ GetMacDragWindowBounds() void GetMacDragWindowBounds ( wxTopLevelWindow * win, int & menubar_height, int & maxy, int & maxx ) ◆ GetMacOptionKeyDown() bool GetMacOptionKeyDown ( )For mac, return an ID for the current space (of "Spaces" fame)
Definition at line 1274 of file wx_utils.cpp.
◆ GetMD5Digest() ◆ GetScreenRect() 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().
◆ 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().
◆ InitDefaultFileArtProvider() void InitDefaultFileArtProvider ( const wxString & dir ) ◆ LoadWindowRectFromRegistry() ◆ Merge() 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(), SPSG_UserArgsBuilder::s_ReadIniArgs(), CSeqGraphicWidget::x_CreatePopupMenu(), and SPSG_UserArgsBuilder::x_MergeOthers().
◆ NcbiChooseColor() ◆ OpenFileBrowser() void OpenFileBrowser ( const wxString & path ) ◆ RemoveChildWindow() void RemoveChildWindow ( wxFrame * parent, wxWindow * child ) ◆ ReportIDError() ◆ ReportMemoryUsage() void ReportMemoryUsage ( ) ◆ RunningInsideNCBI() 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().
◆ s_Average() static unsigned char s_Average ( unsigned char c1, unsigned char c2, double ratio ) static ◆ s_CloneMenuItem() static wxMenuItem* s_CloneMenuItem ( wxMenu & menu, const wxMenuItem & item ) static ◆ s_FindSeparator() static wxMenuItemList::const_iterator s_FindSeparator ( wxMenu & menu, const wxString & text ) static ◆ s_FindSubItem() static wxMenuItemList::const_iterator s_FindSubItem ( wxMenuItemList::const_iterator begin, wxMenuItemList::const_iterator end, const wxString & text, bool skip_named_groups ) static ◆ s_GetCleanMenuText() static wxString s_GetCleanMenuText ( const wxMenuItem & item ) static ◆ s_InsertInUnnamedGroup() static void s_InsertInUnnamedGroup ( wxMenu & menu, wxMenuItem & item ) static ◆ SaveWindowRectToRegistry() ◆ SetMenuItemMarginWidth() void SetMenuItemMarginWidth ( wxMenuItem * item, wxBitmap * bmp ) ◆ ToAbsolutePath() wxString ToAbsolutePath ( const wxString & base, const wxString & rel_path )converts relative path from the current workspace directory to an absolute path
Definition at line 301 of file wx_utils.cpp.
References wxT.
◆ ToArrayString() void ToArrayString ( const vector< string > & in, wxArrayString & out )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().
◆ ToRelativePath() wxString ToRelativePath ( const wxString & base, const wxString & abs_path )converts an absolute path to a relative one based on current workspace directory
Definition at line 281 of file wx_utils.cpp.
References wxT.
◆ ToString() ◆ TruncateText()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().
◆ TruncTextLength()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().
◆ UseDefaultMarginWidth() 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().
◆ WindowSetText() void WindowSetText ( const wxWindow & win, const wxChar * text ) ◆ WrapText() ◆ s_FileArtProvider ◆ sf_FileArtProviderPushedRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4