43 #include <wx/dcclient.h>
44 #include <wx/settings.h>
46 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
47 #include <Carbon/Carbon.h>
59 wxFRAME_NO_TASKBAR | wxBORDER_NONE | wxFRAME_SHAPED;
62 : m_DockContainer(dock_cont),
63 m_BtnFrameColor(128, 128, 128),
64 m_BtnFillColor(224, 224, 224),
67 Create(parent,
wxID_ANY,
wxT(
"Dock Markers Window"),
73 SetBackgroundStyle(wxBG_STYLE_CUSTOM);
82 SetWindowStyleFlag(GetWindowStyleFlag()&~wxFRAME_FLOAT_ON_PARENT);
87 static bool initialized =
false;
102 m_Bitmaps[0] = provider->GetBitmap(
wxT(
"wm_dock_center"));
103 m_Bitmaps[1] = provider->GetBitmap(
wxT(
"wm_dock_left"));
104 m_Bitmaps[2] = provider->GetBitmap(
wxT(
"wm_dock_right"));
106 m_Bitmaps[4] = provider->GetBitmap(
wxT(
"wm_dock_bottom"));
126 int c_y = rc.y + rc.height / 2;
135 int c_x = rc.x + rc.width / 2;
158 wxSize
size = ClientToWindowSize(root_rc.GetSize());
159 SetSize(wxRect(root_rc.GetPosition(),
size));
168 #ifdef __WXOSX_COCOA__
174 #ifdef __WXOSX_COCOA__
203 bool side_visible = (root_rc.height >= kRootMinSize && root_rc.width >= kRootMinSize);
205 int c_x = root_rc.x + root_rc.width / 2;
206 int c_y = root_rc.y + root_rc.height / 2;
241 if(root_changed || target_changed) {
244 wxSize sz_empty(-1, -1);
278 return root_changed || target_changed;
287 wxPoint
orig = ClientToScreen(wxPoint(0,0));
295 #ifdef __WXOSX_COCOA__
318 if( ! btn_rc.IsEmpty()) {
321 dc.DrawBitmap(
bmp, btn_rc.x, btn_rc.y);
330 dc.DrawRectangle(btn_rc);
377 EVT_SIZE(CFloatingFrame::OnSize)
392 #if defined(__WXMSW__)
394 wxFRAME_FLOAT_ON_PARENT | wxCLIP_CHILDREN ;
395 #elif defined(__WXOSX_COCOA__)
396 wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
wxCLOSE_BOX |
397 wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT ;
399 wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
wxCLOSE_BOX |
408 m_DockManager(&manager),
409 m_DockContainer(
NULL)
414 Create(parent,
wxID_ANY, wxEmptyString, pos,
size, kFloatFrameStyle);
418 #ifdef __WXOSX_COCOA__
419 m_titlebar_move =
false;
426 SystemParametersInfo(38 , 0, &
b, 0);
430 #if defined(__WXOSX_CARBON__) || defined(__WXMAC_CARBON__)
436 WindowGroupRef group_class = GetWindowGroupOfClass(kFloatingWindowClass);
437 SetWindowGroup((WindowRef)MacGetTopLevelWindowRef(), group_class);
440 SetExtraStyle(wxWS_EX_PROCESS_IDLE);
469 return CFloatingFrameBaseClass::Destroy();
476 WXDWORD CFloatingFrame::MSWGetStyle(
long flags, WXDWORD *exstyle )
const
478 WXDWORD ms_styles = CFloatingFrameBaseClass::MSWGetStyle(
flags, exstyle);
539 #ifdef __WXOSX_COCOA__
540 if (event.GetTimestamp() < 0) {
541 m_move_start_mouse_pos = ::wxGetMousePosition();
542 m_titlebar_move =
true;
580 wxRect win_rect = GetRect();
585 #ifdef __WXOSX_COCOA__
586 wxPoint pos = ::wxGetMousePosition();
587 wxPoint
delta = pos - m_move_start_mouse_pos;
588 win_rect.Offset(
delta);
605 #ifndef __WXOSX_COCOA__
606 constexpr
int kMaxMoveDelta = 30;
658 #ifdef __WXOSX_COCOA__
659 if (m_titlebar_move ==
true) {
660 wxPoint pos = ::wxGetMousePosition();
661 if (pos != m_prev_mouse_pos) {
662 m_prev_mouse_pos = pos;
663 wxMoveEvent
dummy(pos, wxEVT_MOVING);
670 #ifdef __WXOSX_COCOA__
671 m_titlebar_move =
false;
676 wxPoint
offset = ::wxGetMousePosition() - GetPosition();
682 int max_x = wxSystemSettings::GetMetric(wxSYS_DRAG_X) / 2;
683 int max_y = wxSystemSettings::GetMetric(wxSYS_DRAG_Y) / 2;
684 bool drop =
abs(delta_x) <= max_x &&
abs(delta_y) <= max_y;
716 wxPoint sc_mouse_pos = ::wxGetMousePosition();
725 bool active =
event.GetActive();
731 #if !defined(NCBI_OS_LINUX) && !defined(NCBI_OS_MSWIN)
767 return wxGetMouseState().LeftIsDown();
CDockContainer is a window that hosts docked windows.
CDockManager & GetDockManager()
CDockManager CDockManager sends requests to Window Manager, Window Manager makes decisions about dele...
void OnFloatingPaneBeginMove(CFloatingFrame &frame, const wxPoint &sc_mouse_pos)
void OnKeyDown(wxKeyEvent &event)
void OnKeyUp(wxKeyEvent &event)
void OnFloatingFrameActivateEvent(CFloatingFrame *frame, bool active)
void OnFrameClosePressed(CFloatingFrame *frame)
void OnFloatingPaneEndMove(CFloatingFrame &frame, CDockManager::EDragResult result, const wxPoint &sc_mouse_pos)
void OnFloatingPaneMoving(CFloatingFrame &frame, const wxPoint &sc_mouse_pos)
CDockMarkerWindow - top level window with docking markers displayed on top of the application window.
void OnPaint(wxPaintEvent &event)
wxRect m_CenterBottomRect
bool x_UpdateLayout(const wxRect &root_rc, const wxRect &target_rc)
virtual EDockEffect HitTest(const wxPoint &screen_pt)
determines whether a given position is inside one of the 9 markers and returns the corresponding dock...
void x_DrawButton(wxDC &dc, const wxRect &btn_rc, int index)
void SetTargetRect(const wxRect &root_rc, const wxRect &target_rc)
CDockManager * m_DockManager
virtual ~CFloatingFrame()
virtual CDockContainer * GetDockContainer()
void OnKeyUp(wxKeyEvent &event)
virtual void SetDockContainer(CDockContainer *dock_cont)
void OnMotion(wxMouseEvent &evt)
void OnIdle(wxIdleEvent &event)
virtual void OnMoveFinished(bool drop)
static bool isMouseDown()
void OnKeyDown(wxKeyEvent &event)
virtual void OnMoveStart()
void OnActivate(wxActivateEvent &event)
void OnClose(wxCloseEvent &event)
CDockContainer * m_DockContainer
void OnMovingEvent(wxMoveEvent &event)
CFloatingFrame(CDockManager &manager, wxWindow *parent, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
void ApplyAccelerators(wxWindow *frame)
apply accumulated accelerators to the specifed frame
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
IMPLEMENT_CLASS(CFloatingFrame, CFloatingFrameBaseClass) const static long kFloatFrameStyle
CFloatingFrame.
static long kMarkersStyle
static int kCenterBtnSize
#define CFloatingFrameBaseClass
CFloatingFrame - a top level floating frame that can host a Dock Container.
thread_local unique_ptr< FtaMsgPost > bmp
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
const struct ncbi::grid::netcache::search::fields::SIZE size
#define TRUE
bool replacment for C indicating true.
Int4 delta(size_t dimension_, const Int4 *score_)
wxFileArtProvider * GetDefaultFileArtProvider()
void BroadcastCommandToChildWindows(wxWindow *window, int cmd_id, int cmd_data=0)
Sends command event with id 'cmd_id' to window and all its children.