예제 #1
0
DisplayVariableDlg::DisplayVariableDlg( wxWindow* parent)
    : clDebuggerTipWindowBase( parent )
    , m_debugger(NULL)
    , m_keepCurrentPosition(false)
    , m_dragging(false)
    , m_editDlgIsUp(false)
{
    Hide();
    Centre();
    MSWSetNativeTheme(m_treeCtrl);
    m_timer2 = new wxTimer(this);
    m_mousePosTimer = new wxTimer(this);

    SetName("clDebuggerEditItemDlgBase");
    
    bool sizeSet(false);
    if (!wxPersistenceManager::Get().Find(this)) {
        sizeSet = wxPersistentRegisterAndRestore(this, "CLDebuggerTip");
    }
    wxUnusedVar(sizeSet);
    if (GetSize().x < 100 || GetSize().y < 100 ) {
        SetSize( wxRect(GetPosition(), wxSize(100, 100) ) );
    }

    Connect(m_timer2->GetId(),        wxEVT_TIMER, wxTimerEventHandler(DisplayVariableDlg::OnTimer2), NULL, this);
    Connect(m_mousePosTimer->GetId(), wxEVT_TIMER, wxTimerEventHandler(DisplayVariableDlg::OnCheckMousePosTimer), NULL, this);
    m_panelStatusBar->Connect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(DisplayVariableDlg::OnCaptureLost), NULL, this);
}
예제 #2
0
//
// Destructer
//
ToolManager::~ToolManager()
{
   // Save the toolbar states
   WriteConfig();

   // Remove handlers from parent
   mParent->Disconnect( wxEVT_LEFT_UP,
                        wxMouseEventHandler( ToolManager::OnMouse ),
                        NULL,
                        this );
   mParent->Disconnect( wxEVT_MOTION,
                        wxMouseEventHandler( ToolManager::OnMouse ),
                        NULL,
                        this );
   mParent->Disconnect( wxEVT_MOUSE_CAPTURE_LOST,
                        wxMouseCaptureLostEventHandler( ToolManager::OnCaptureLost ),
                        NULL,
                        this );

   // Remove our event handlers
   mIndicator->Disconnect( wxEVT_CREATE,
                           wxWindowCreateEventHandler( ToolManager::OnIndicatorCreate ),
                           NULL,
                           this );
   mIndicator->Disconnect( wxEVT_PAINT,
                           wxPaintEventHandler( ToolManager::OnIndicatorPaint ),
                           NULL,
                           this );
}
예제 #3
0
clResizableTooltipBase::~clResizableTooltipBase()
{
    m_treeCtrl->Disconnect(wxEVT_COMMAND_TREE_ITEM_EXPANDING, wxTreeEventHandler(clResizableTooltipBase::OnItemExpanding), NULL, this);
    m_panelStatus->Disconnect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusEnterWindow), NULL, this);
    m_panelStatus->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusLeaveWindow), NULL, this);
    m_panelStatus->Disconnect(wxEVT_MOTION, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarMotion), NULL, this);
    m_panelStatus->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftUp), NULL, this);
    m_panelStatus->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftDown), NULL, this);
    m_panelStatus->Disconnect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(clResizableTooltipBase::OnCaptureLost), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftDown), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_LEFT_UP, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftUp), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_MOTION, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarMotion), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusLeaveWindow), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusEnterWindow), NULL, this);
    m_staticBitmap240->Disconnect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(clResizableTooltipBase::OnCaptureLost), NULL, this);
    m_timerCheckMousePos->Disconnect(wxEVT_TIMER, wxTimerEventHandler(clResizableTooltipBase::OnCheckMousePosition), NULL, this);
    
    m_timerCheckMousePos->Stop();
    wxDELETE( m_timerCheckMousePos );

}
예제 #4
0
DisplayVariableDlg::~DisplayVariableDlg()
{
    Disconnect(m_timer2->GetId(), wxEVT_TIMER, wxTimerEventHandler(DisplayVariableDlg::OnTimer2), NULL, this);
    m_panelStatusBar->Disconnect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(DisplayVariableDlg::OnCaptureLost), NULL, this);

    m_timer2->Stop();
    m_mousePosTimer->Stop();

    wxDELETE(m_timer2);
    wxDELETE(m_mousePosTimer);

    
}
예제 #5
0
//
// Destructer
//
ToolManager::~ToolManager()
{
   // Save the toolbar states
   WriteConfig();

   // Remove handlers from parent
   mParent->Disconnect( wxEVT_LEFT_UP,
                        wxMouseEventHandler( ToolManager::OnMouse ),
                        NULL,
                        this );
   mParent->Disconnect( wxEVT_MOTION,
                        wxMouseEventHandler( ToolManager::OnMouse ),
                        NULL,
                        this );
   mParent->Disconnect( wxEVT_MOUSE_CAPTURE_LOST,
                        wxMouseCaptureLostEventHandler( ToolManager::OnCaptureLost ),
                        NULL,
                        this );

   // Remove our event handlers
   mIndicator->Disconnect( wxEVT_CREATE,
                           wxWindowCreateEventHandler( ToolManager::OnIndicatorCreate ),
                           NULL,
                           this );
   mIndicator->Disconnect( wxEVT_PAINT,
                           wxPaintEventHandler( ToolManager::OnIndicatorPaint ),
                           NULL,
                           this );

   // Must destroy the window since it doesn't have a parent
   mIndicator->Destroy();

   // Delete the indicator regions
   delete mLeft;
   delete mDown;
}
예제 #6
0
//
// Constructor
//
ToolManager::ToolManager( AudacityProject *parent )
: wxEvtHandler()
{
   wxPoint pt[ 3 ];

#if defined(__WXMAC__)
   // Save original transition
   mTransition = wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION );
#endif

   // Initialize everything
   mParent = parent;
   mLastPos.x = mBarPos.x = -1;
   mLastPos.y = mBarPos.y = -1;
   mDragWindow = NULL;
   mDragDock = NULL;
   mDragBar = NULL;

   // Create the down arrow
   pt[ 0 ].x = 0;
   pt[ 0 ].y = 0;
   pt[ 1 ].x = 9;
   pt[ 1 ].y = 9;
   pt[ 2 ].x = 18;
   pt[ 2 ].y = 0;

   // Create the shaped region
   mDown = new wxRegion( 3, &pt[0] );

   // Create the down arrow
   pt[ 0 ].x = 9;
   pt[ 0 ].y = 0;
   pt[ 1 ].x = 0;
   pt[ 1 ].y = 9;
   pt[ 2 ].x = 9;
   pt[ 2 ].y = 18;

   // Create the shaped region
   mLeft = new wxRegion( 3, &pt[0] );

   // Create the indicator frame
   mIndicator = new wxFrame( NULL,
                             wxID_ANY,
                             wxEmptyString,
                             wxDefaultPosition,
                             wxSize( 32, 32 ),
                             wxFRAME_TOOL_WINDOW |
                             wxFRAME_SHAPED |
                             wxNO_BORDER |
                             wxFRAME_NO_TASKBAR |
                             wxSTAY_ON_TOP );

   // Hook the creation event...only needed on GTK, but doesn't hurt for all
   mIndicator->Connect( wxEVT_CREATE,
                        wxWindowCreateEventHandler( ToolManager::OnIndicatorCreate ),
                        NULL,
                        this );

   // Hook the paint event...needed for all
   mIndicator->Connect( wxEVT_PAINT,
                        wxPaintEventHandler( ToolManager::OnIndicatorPaint ),
                        NULL,
                        this );

   // It's a little shy
   mIndicator->Hide();

   // Hook the parents mouse events...using the parent helps greatly
   // under GTK
   mParent->Connect( wxEVT_LEFT_UP,
                     wxMouseEventHandler( ToolManager::OnMouse ),
                     NULL,
                     this );
   mParent->Connect( wxEVT_MOTION,
                     wxMouseEventHandler( ToolManager::OnMouse ),
                     NULL,
                     this );
   mParent->Connect( wxEVT_MOUSE_CAPTURE_LOST,
                     wxMouseCaptureLostEventHandler( ToolManager::OnCaptureLost ),
                     NULL,
                     this );

   // Create the top and bottom docks
   mTopDock = new ToolDock( this, mParent, TopDockID );
   mBotDock = new ToolDock( this, mParent, BotDockID );

   // Create all of the toolbars
   mBars[ ToolsBarID ]         = new ToolsToolBar();
   mBars[ TransportBarID ]     = new ControlToolBar();
   mBars[ MeterBarID ]         = new MeterToolBar();
   mBars[ EditBarID ]          = new EditToolBar();
   mBars[ MixerBarID ]         = new MixerToolBar();
   mBars[ TranscriptionBarID ] = new TranscriptionToolBar();
   mBars[ SelectionBarID ]     = new SelectionBar();
   mBars[ DeviceBarID ]        = new DeviceToolBar();

   // We own the timer
   mTimer.SetOwner( this );

   // Process the toolbar config settings
   ReadConfig();
}
예제 #7
0
clResizableTooltipBase::clResizableTooltipBase(wxWindow* parent,long style)
    : wxPopupWindow(parent, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9D6CInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* boxSizer222 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer222);
    
    m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(300,250), wxTAB_TRAVERSAL|wxBORDER_THEME);
    m_mainPanel->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
    m_mainPanel->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
    
    boxSizer222->Add(m_mainPanel, 1, wxALL|wxEXPAND, 2);
    
    wxBoxSizer* boxSizer230 = new wxBoxSizer(wxVERTICAL);
    m_mainPanel->SetSizer(boxSizer230);
    
    m_treeCtrl = new wxTreeCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTR_DEFAULT_STYLE|wxBORDER_NONE);
    m_treeCtrl->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
    m_treeCtrl->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
    
    boxSizer230->Add(m_treeCtrl, 1, wxEXPAND, 0);
    m_mainPanel->SetMinSize(wxSize(300,250));
    
    m_panelStatus = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_panelStatus->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
    m_panelStatus->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
    
    boxSizer222->Add(m_panelStatus, 0, wxALL|wxEXPAND, 0);
    
    wxBoxSizer* boxSizer234 = new wxBoxSizer(wxHORIZONTAL);
    m_panelStatus->SetSizer(boxSizer234);
    
    boxSizer234->Add(0, 0, 1, wxALL, 5);
    
    m_staticBitmap240 = new wxStaticBitmap(m_panelStatus, wxID_ANY, wxXmlResource::Get()->LoadBitmap(wxT("resize")), wxDefaultPosition, wxSize(-1,-1), 0 );
    m_staticBitmap240->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
    
    boxSizer234->Add(m_staticBitmap240, 0, wxALIGN_CENTER_VERTICAL, 5);
    
    m_timerCheckMousePos = new wxTimer;
    m_timerCheckMousePos->Start(25, false);
    
    SetName(wxT("clResizableTooltipBase"));
    SetMinClientSize(wxSize(300,200));
    SetSize(300,200);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    // Connect events
    m_treeCtrl->Connect(wxEVT_COMMAND_TREE_ITEM_EXPANDING, wxTreeEventHandler(clResizableTooltipBase::OnItemExpanding), NULL, this);
    m_panelStatus->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusEnterWindow), NULL, this);
    m_panelStatus->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusLeaveWindow), NULL, this);
    m_panelStatus->Connect(wxEVT_MOTION, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarMotion), NULL, this);
    m_panelStatus->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftUp), NULL, this);
    m_panelStatus->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftDown), NULL, this);
    m_panelStatus->Connect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(clResizableTooltipBase::OnCaptureLost), NULL, this);
    m_staticBitmap240->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftDown), NULL, this);
    m_staticBitmap240->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarLeftUp), NULL, this);
    m_staticBitmap240->Connect(wxEVT_MOTION, wxMouseEventHandler(clResizableTooltipBase::OnStatusBarMotion), NULL, this);
    m_staticBitmap240->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusLeaveWindow), NULL, this);
    m_staticBitmap240->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(clResizableTooltipBase::OnStatusEnterWindow), NULL, this);
    m_staticBitmap240->Connect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(clResizableTooltipBase::OnCaptureLost), NULL, this);
    m_timerCheckMousePos->Connect(wxEVT_TIMER, wxTimerEventHandler(clResizableTooltipBase::OnCheckMousePosition), NULL, this);
    
}