53 #include <wx/msgdlg.h>
54 #include <wx/scrolbar.h>
64 const wxPoint& pos,
const wxSize&
size,
68 m_PopupMenuSourcePos(0),
156 if (character_size.
m_Y > 0 && character_size.
m_X > 0)
203 if (character_size.
m_Y > 0 && character_size.
m_X > 0)
208 if (old_limits.
Left() != new_limits.
Left()
210 || old_limits.
Top() != new_limits.
Top()
235 TSeqPos chars_in_line, lines_in_seq;
237 max_val = lines_in_seq +
m_SequencePane->GetScrollAdjustmentForLastLineVariations();
244 TSeqPos curr_pos = 0, chars_in_line, lines_in_seq;
247 if (chars_in_line > 0) {
248 curr_pos = source_pos / chars_in_line;
256 wxScrollBar* scroll_bar_v = (wxScrollBar*)FindWindow(
ID_VSCROPLLBAR);
257 wxScrollBar* scroll_bar_h = (wxScrollBar*)FindWindow(
ID_HSCROPLLBAR);
265 if (curr_pos > max_val) curr_pos = max_val;
268 if (page_size < 0) page_size = 0;
269 int thumb_size = page_size;
270 if (max_val <= (
TSeqPos) page_size) {
272 scroll_bar_v->SetScrollbar (0, 0, 0, 0,
true);
275 scroll_bar_v->SetScrollbar (curr_pos, thumb_size, max_val, page_size,
true);
280 scroll_bar_h->Hide();
293 curr_pos = (
int) ceil(rcAll.
Top() - rcVisible.
Top());
302 TSeqPos chars_in_line, lines_in_seq;
305 return curr_pos * chars_in_line;
312 double desired_pos = rcAll.
Top() - pos;
313 double dY = desired_pos - rcVisible.
Top();
350 bool found_in_source;
351 pos =
m_SequencePane->STG_GetSourcePosBySequencePos(pos, &found_in_source);
374 if (source_pos >= 0) {
377 range.Set(source_pos,
static_cast<TSeqPos>(source_pos + fragment.length() - 1));
393 wxScrollBar* scroll_bar_v = (wxScrollBar*)FindWindow(
ID_VSCROPLLBAR);
401 if (page_size < 0) page_size = 0;
402 int thumb_size = page_size;
403 if (max_val <= page_size) {
405 scroll_bar_v->SetScrollbar (0, 0, 0, 0,
true);
408 scroll_bar_v->SetScrollbar (scroll_pos, thumb_size, max_val, page_size,
true);
418 TSeqPos first_selection_start = 0;
421 if(! s_coll.
empty()) {
423 first_selection_start = it_r->GetFrom();
502 return visible_range;
577 unique_ptr<wxMenu> root(cmd_reg.
CreateMenu(sPopupMenu));
578 PopupMenu(root.get());
CEvent - generic event implementation TODO TODO - Attachments.
TThisType & CombineWith(const TRange &r)
CSeqTextDataSource implements Adapter design pattern.
int FindSequenceFragment(const string &fragment, TSeqPos start_search)
TSeqPos SequencePosToSourcePos(TSeqPos sequence_pos, bool *found_in_source=NULL)
TSeqPos SourcePosToSequencePos(TSeqPos source_pos)
TSeqPos m_PopupMenuSourcePos
bool GetShowFeaturesInLowerCase()
void SetHost(ISeqTextWidgetHost *pHost)
objects::CSeq_loc * GetVisibleRange()
void ScrollToSequencePosition(TSeqPos pos, bool notify=true)
void SetFontSize(int font_size)
virtual void x_OnScrollX(int pos)
void UpdateLastSourcePos()
void x_SetScrollPosition(int scroll_pos)
virtual CGlPane & GetPort()
implement these 2 functions in derived classes
virtual void x_UpdatePane()
virtual void x_SetPortLimits()
updates model limits of the Master CGlPane
virtual CSeqTextDataSource * GetDS()
void OnDisableCommands(wxUpdateUIEvent &event)
void OnHasSelection(wxUpdateUIEvent &event)
virtual void SetScaleX(TModelUnit scale_x, const TModelPoint &point)
void ShowFeaturesInLowerCase(bool do_lower)
virtual void x_CreatePane()
factory method creating master pane, called form x_CreateControls()
virtual void x_UpdateScrollbars()
TSeqPos x_GetSourcePosForPortScrollValue()
unique_ptr< CSeqTextPane > m_SequencePane
void ScrollToPosition(TSeqPos pos, bool notify=true)
virtual ~CSeqTextWidget()
virtual void x_OnScrollY(int pos)
CSeqTextWidget(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
class CSeqTextWidget
void OnCopySelection(wxCommandEvent &event)
ISeqTextWidgetHost * m_pHost
void AdjustModelForSequenceAndWindowSize()
void ResetObjectSelection()
void SelectObject(const CObject *obj)
void DeSelectObject(const CObject *obj)
void ReportMouseOverPos(TSeqPos pos)
int GetCaseFeatureSubtype()
virtual void SetDataSource(CSeqTextDataSource &ds)
const TRangeColl & GetSelection() const
TSeqPos x_GetScrollValueForSourcePos(TSeqPos source_pos)
void OnScrollToSelection(wxCommandEvent &event)
CRef< CSeqTextDataSource > m_DataSource
void ChooseCaseFeature(objects::CSeqFeatData::ESubtype subtype)
void SetRangeSelection(const TRangeColl &segs)
void x_MakePortMatchScrollValue(int pos)
virtual void x_Update()
Update handlers.
void OnClearSelection(wxCommandEvent &event)
virtual CGlWidgetPane * x_GetPane()
void ScrollToText(const string &fragment, TSeqPos start_search)
void Configure(wxCommandEvent &event)
void ScrollToSourcePosition(TSeqPos pos, bool notify=true)
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
@ eWidgetRangeChanged
notification from child to parent that the visible range has changed
virtual void STWH_ReportMouseOverPos(TSeqPos pos)=0
virtual void STWH_ChangeConfig()=0
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void SetModelLimitsRect(const TModelRect &R)
void SetScale(TModelUnit scale_x, TModelUnit scale_y, TModelPoint p_center)
TModelRect & GetModelLimitsRect(void)
void Scroll(TModelUnit dx, TModelUnit dy)
void SetAdjustmentPolicy(int adjust_x, int adjust_y)
void EnableZoom(bool en_x, bool en_y)
TModelRect & GetVisibleRect(void)
void SetMinScaleX(TModelUnit scale)
void SetOriginType(EOriginType type_x, EOriginType type_y)
virtual bool Send(CEvent *evt, EDispatch disp_how=eDispatch_Default, int pool_name=ePool_Default)
Sends an event synchronously.
@ eEvent_Message
message from one class to another
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
range(_Ty, _Ty) -> range< _Ty >
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
USING_SCOPE(ncbi::objects)
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
#define WX_MENU_ITEM(cmd)