*
data= anEvent.GetClientData();
88anEvent.SetClientData(
NULL);
89 delete(wxMenu*)
data;
97m_Panel->GetCurrentCtrl()->PopupMenu( menu.get() );
101 #define ACTIVE_VIEW_TARGET_IX 0 102 #define ALL_VIEWS_TARGET_IX 1 104 #define ID_TABLE 10001 105 #define ID_TEXT 10002 106 #define ID_TOOLBAR 10003 107 #define ID_COMBOBOX 10004 119, m_TargetChoice(
NULL)
120, m_DisplayMode(eInvalidDisplayMode)
121, m_ListWidget(
NULL)
122, m_TextWidget(
NULL)
129 #ifdef __WXOSX_COCOA__ 130SetBackgroundStyle(wxBG_STYLE_COLOUR);
131SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_FRAMEBK));
134wxPanel::Create( parent,
id, pos,
size);
143PopEventHandler(
true);
144PopEventHandler(
true);
146 returnwxPanel::Destroy();
156 static bools_RegisteredIcons =
false;
159 if( ! s_RegisteredIcons ){
166s_RegisteredIcons =
true;
172wxSizer* sizer =
newwxBoxSizer( wxVERTICAL );
176wxToolBar* toolBar =
newwxToolBar(
177 this,
ID_TOOLBAR, wxDefaultPosition, wxDefaultSize,
178wxTB_FLAT | wxTB_HORIZONTAL | wxTB_TEXT | wxTB_HORZ_LAYOUT
182wxArtProvider::GetBitmap(
wxT(
"menu::insp_table_mode")),
183wxNullBitmap,
wxT(
"Table mode"));
185wxArtProvider::GetBitmap(
wxT(
"menu::insp_brief_text_mode")),
186wxNullBitmap,
wxT(
"Brief Text mode"));
188wxArtProvider::GetBitmap(
wxT(
"menu::insp_text_mode") ),
189wxNullBitmap,
wxT(
"Full Text mode"));
190toolBar->AddSeparator();
201sizer->Add( toolBar, 0, wxEXPAND );
204wxStaticLine* line =
newwxStaticLine(
205 this, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL
207sizer->Add( line, 0, wxEXPAND );
218 m_TextWidget->
SetFont(wxFont(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
289 void*
data= anEvent.GetClientData();
290menu =
data? (wxMenu*)
data:
newwxMenu();
293anEvent.SetClientData( menu );
298anEvent.SetClientData(
NULL);
318 if( new_mode ==
eTable){
345 switch( update.
GetID() ){
399 if( target_ix == wxNOT_FOUND ){
408 strings_active =
"Active View";
414 if( current_client ){
430 if( clients.empty() ){
444 strings =
client->GetSelClientLabel();
447 if(
client== cur_target ){
466 if( !
m_Service|| target_ix == wxNOT_FOUND ){
478 client->GetActiveObjects( tmp_sel_objs );
494 if(find(active_clients.begin(), active_clients.end(),
client) == active_clients.end()) {
500 client->GetActiveObjects( tmp_sel_objs );
506auto loc = dynamic_cast<const objects::CSeq_loc*>(&*obj.object);
507return loc && loc->GetTotalRange().GetLength() <= 0;
508}), tmp_sel_objs.end());
510 boolmatched =
false;
515objs.
insert(iter->object.GetPointerOrNull());
519 if(objs.count(iter->object.GetPointerOrNull()) == 0) {
551m_SaveCanceled = m_Context.
SetCanceled(canceled);
567 typedeftuple<unique_ptr<CCompositeTextItem>, unique_ptr<CTextPanelContext> > TResult;
571fontDesc =
m_TextWidget->GetFont().GetNativeFontInfoDesc(),
576auto rootItem = std::make_unique<CCompositeTextItem>();
577auto context = std::make_unique<CTextPanelContext>(1, nullptr, nullptr);
579context->SetFontDesc(fontDesc);
581string logMsg(
"CTextJob: ");
584NON_CONST_ITERATE(TConstScopedObjects, it, objects) {
585if (canceled.IsCanceled())
588if (rootItem->GetItemCount() > 0) {
589CPlainTextItem* itemDiv = new CPlainTextItem();
590itemDiv->AddLine(
" ");
591rootItem->AddItem(itemDiv, false);
593rootItem->AddItem(CObjectTextItem::CreateTextItem(*it, mode, &canceled), false);
600 catch(std::exception& e) {
608CCancelGuard guard(&canceled, *
context);
610wxFont font(
context->GetFontDesc());
613rootItem->CalcSize(dc,
context.get());
618std::get<0>(
result) = std::move(rootItem);
625 stringerrMsg =
"Unknown fatal error";
629unique_ptr<CCompositeTextItem> rootItem(std::move(std::get<0>(
result)));
630unique_ptr<CTextPanelContext>
context(std::move(std::get<1>(
result)));
633textWidget->ReportError(
"No data");
636textWidget->SetMainItem(rootItem.release(),
context.release());
637textWidget->Layout();
638textWidget->Refresh();
645 catch(
conststd::exception& e) {
649textWidget->ReportError(
"Failed: "+ errMsg);
651,
"Generate Selection Text"));
void remove_if(Container &c, Predicate *__pred)
ICanceled * m_SaveCanceled
CCancelGuard(ICanceled *canceled, CTextPanelContext &context)
CTextPanelContext & m_Context
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
class CRegistryReadView provides a nested hierarchical view at a particular key.
virtual void LoadSettings()
static const int scm_ModeCmd
virtual void Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
virtual void SetRegistryPath(const string ®_path)
void SetSelectionService(CSelectionService *service)
void x_ResetObjectWidget()
void Init()
Initialises member variables.
ISelectionClient * m_SelView
void OnModeChanged(wxCommandEvent &event)
CTextItemPanel * m_TextWidget
EDisplayMode m_DisplayMode
wxWindow * GetCurrentCtrl()
virtual void SaveSettings() const
std::unique_ptr< async_job > m_Future
void x_ResetTargetChoice()
void OnContextMenu(wxContextMenuEvent &event)
wxChoice * m_TargetChoice
void OnSelServiceStateChange(CSelectionServiceEvent &update)
CSelectionService * m_Service
void OnTargetChanged(wxCommandEvent &event)
void GetSelection(TConstScopedObjects &buf) const
CObjectListWidget * m_ListWidget
CWeakIRef< ISelectionClient > m_CurrentClientWeakPtr
void x_InitCurrentWidget()
void CreateControls()
Creates the controls and sizers.
TConstScopedObjects m_SelObjects
CIRef< ISelectionClient > GetClient()
void GetClients(TClients &clients)
vector< ISelectionClient * > TClients
virtual bool IsAttached(ISelectionClient *client) const
CSelectionPanel * m_Panel
CSelectionViewEventHandler(CSelectionPanel *panel)
void OnContextMenu(wxContextMenuEvent &anEvent)
CTextPanelContext * GetContext()
virtual bool SetFont(const wxFont &font)
ICanceled * SetCanceled(ICanceled *canceled)
void SetContextMenuEventPropagation(bool flag)
void LoadTableSettings(const CRegistryReadView &view, bool byName=false)
void SaveTableSettings(CRegistryWriteView &view, bool saveSorting=true) const
Interface for testing cancellation request in a long lasting operation.
ISelectionClient - represents an object that support a notion of selection.
virtual string GetSelClientLabel()=0
returns a string identifying the client in UI
iterator_bool insert(const value_type &val)
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
#define NCBI_REPORT_EXCEPTION(title, ex)
Generate a report on the exception.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
const TEventID GetID(void) const
Inline Implementation.
vector< SConstScopedObject > TConstScopedObjects
TRefType Lock(void) const
Lock the object and return reference to it.
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
job_function_traits< _Fty >::future job_async(const _Fty &_Fnarg, const string &descr)
const struct ncbi::grid::netcache::search::fields::SIZE size
wxMenu * CreateContextMenuBackbone()
#define ALL_VIEWS_TARGET_IX
#define ACTIVE_VIEW_TARGET_IX
static CNamedPipeClient * client
static CS_CONTEXT * context
wxFileArtProvider * GetDefaultFileArtProvider()
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible
wxString ToWxString(const string &s)
void CleanupSeparators(wxMenu &menu)
Removes extra separators (in the begining or at the end of the menu, ot those that precede other sepa...
RetroSearch 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