Esempio n. 1
0
RendererOGL::RendererOGL(MainFrame *parent, wxWindowID id,
						   const wxPoint& pos, const wxSize& size, long style, const wxString& name)
: wxGLCanvas(parent, id, attribList, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name)
{
    m_initialized = false;
    m_parent      = parent;
    m_glList      = 0;
	m_fov         = 28.0f;
    m_zNear       = 20.0f;
    m_zFar        = 1000.0f;
    m_glContext   = NULL;
    m_mouseNewX = m_mouseNewY = m_mouseOldX = m_mouseOldY = 0;
    m_mouseWheel = 0;
    m_mouseLeft = m_mouseRight = false;
    m_restoreTo2D = m_restoreTo3D = false;
    m_filter = 0.1f;
    
    float h = 42.75f;
    float radFov = m_fov * PI / 180.0f;
    float dist = (h/2.0f) / (float)tan(radFov/2.0f);
    m_minZ = -(dist+16);
    
    m_camera3D.Set(0, -2, -300, -30, 30, 0);
    m_camera2D.Set(0, -32.9f, m_minZ, 0, 0, 0);
    m_camera.CopyFrom(m_camera2D);

	SetWinRenderer(parent, this);
#ifdef __WXGTK__
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
#else
    SetBackgroundStyle(wxBG_STYLE_PAINT);
#endif
}
Esempio n. 2
0
DefaultWorkspacePage::DefaultWorkspacePage(wxWindow* parent)
    : DefaultWorkspacePageBase(parent)
{
    // Allow the PHP view to accepts folders
    SetBackgroundStyle(wxBG_STYLE_PAINT);
    
    
    wxColour bg = clSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
    m_colours.InitFromColour(bg);
    if(clConfig::Get().Read("UseCustomBaseColour", false)) {
        bg = clConfig::Get().Read("BaseColour", bg);
        m_colours.InitFromColour(bg);
    }
    m_staticText523->SetBackgroundColour(m_colours.GetBgColour());
    m_staticText523->SetForegroundColour(m_colours.GetItemTextColour());
    
    
    SetDropTarget(new clFileOrFolderDropTarget(this));
    m_staticText523->SetBackgroundColour(m_colours.GetBgColour());
    m_staticText523->SetForegroundColour(m_colours.GetItemTextColour());
    SetBackgroundColour(clSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
    m_staticBitmap521->SetDropTarget(new clFileOrFolderDropTarget(this));
    Bind(wxEVT_DND_FOLDER_DROPPED, &DefaultWorkspacePage::OnFolderDropped, this);
    EventNotifier::Get()->Bind(wxEVT_CMD_COLOURS_FONTS_UPDATED, &DefaultWorkspacePage::OnColoursChanged, this);
    Bind(wxEVT_PAINT, &DefaultWorkspacePage::OnPaint, this);
    Bind(wxEVT_ERASE_BACKGROUND, [](wxEraseEvent& e) { wxUnusedVar(e); });
}
Esempio n. 3
0
        NavBar::NavBar(wxWindow* parent, DocumentViewHolder& documentViewHolder) :
        wxPanel(parent),
        m_documentViewHolder(documentViewHolder),
        m_navPanel(new wxPanel(this, wxID_ANY)),
        m_searchBox(new wxSearchCtrl(this, wxID_ANY)) {
#ifdef __APPLE__
            m_searchBox->SetFont(*wxSMALL_FONT);
            SetBackgroundStyle(wxBG_STYLE_PAINT);
            Bind(wxEVT_PAINT, &NavBar::OnPaint, this);
#endif
            m_searchBox->Bind(wxEVT_COMMAND_TEXT_UPDATED, &NavBar::OnSearchPatternChanged, this);
            
            wxSizer* innerSizer = new wxBoxSizer(wxHORIZONTAL);
            innerSizer->AddSpacer(4);
            innerSizer->Add(m_navPanel, 1, wxEXPAND );
            innerSizer->Add(m_searchBox, 0, wxEXPAND );
#ifdef __APPLE__
            innerSizer->AddSpacer(4);
#endif
            innerSizer->SetItemMinSize(m_searchBox, 200, wxDefaultSize.y);
            
            wxSizer* outerSizer = new wxBoxSizer(wxVERTICAL);
            outerSizer->AddSpacer(2);
            outerSizer->Add(innerSizer, 1, wxEXPAND);
            outerSizer->AddSpacer(2);
            SetSizer(outerSizer);
    }
Esempio n. 4
0
// ctor
StatWin::StatWin(wxFrame *frame):
 wxWindow(frame, wxID_ANY, wxPoint(20,20), wxSize(5,5), wxSIMPLE_BORDER)

{
      int x,y;
      GetClientSize(&x, &y);

      m_backBrush = wxBrush(GetGlobalColor(_T("UIBDR")), wxSOLID);

      SetBackgroundColour(GetGlobalColor(_T("UIBDR")));

      SetBackgroundStyle(wxBG_STYLE_CUSTOM);  // on WXMSW, this prevents flashing on color scheme change

      m_rows = 1;

 //   Create the Children

      pPiano = new PianoWin((wxFrame *)this);
      pPiano->SetSize(0, 0, x *6/10, y*1/m_rows);

#ifdef USE_WIFI_CLIENT
      pWiFi = new WiFiStatWin((wxFrame *)this);
      pWiFi->SetSize(x * 6/10, 0, x *4/10, y * 1/m_rows);
#endif

 }
Esempio n. 5
0
bool wxSplitWindow::Create (wxWindow *parent, wxWindowID id,
                            const wxPoint& pos,
                            const wxSize& size,
                            long style,
                            const wxString& name) {

    // allow TABbing from one window to the other
    style |= wxTAB_TRAVERSAL;

    // we draw our border ourselves to blend the sash with it
    style &= ~wxBORDER_MASK;
    style |= wxBORDER_NONE;

    if (!wxWindow::Create (parent, id, pos, size, style, name)) return false;

    if (size.x >= 0) m_lastSize.x = size.x;
    if (size.y >= 0) m_lastSize.y = size.y;

    m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0;

    // FIXME: with this line the background is not erased at all under GTK1,
    //        so temporary avoid it there
#if !defined(__WXGTK__) || defined(__WXGTK20__)
    // don't erase the splitwindow background, it's pointless as we overwrite it anyhow
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
#endif

    return true;
}
Esempio n. 6
0
/// Creation
bool InstanceCtrl::Create(wxWindow* parent, InstanceModel *instList, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
{
	m_instList = instList;

	if (!wxScrolledCanvas::Create(parent, id, pos, size, style | wxFULL_REPAINT_ON_RESIZE | wxWANTS_CHARS))
		return false;
		
	SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
	CalculateOverallItemSize();
	m_itemsPerRow = CalculateItemsPerRow();
	m_intended_column = 0;
	
	SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);
	DisableKeyboardScrolling();
	ShowScrollbars(wxSHOW_SB_NEVER, wxSHOW_SB_ALWAYS);
	
	// Tell the sizers to use the given or best size
	SetInitialSize(size);
	
	// Create a buffer
	RecreateBuffer(size);
	
	return true;
}
Esempio n. 7
0
MapGridCtrl::MapGridCtrl(wxWindow* parent, wxSize size, wxWindowID id)
    : wxPanel(parent, id, wxDefaultPosition, size, wxSIMPLE_BORDER | wxFULL_REPAINT_ON_RESIZE)
    , m_async_image(std::bind(&MapGridCtrl::OnGetMapImageAsyncCompleted, this, std::placeholders::_1))
    , m_async_ex(std::bind(&MapGridCtrl::OnGetMapExAsyncCompleted, this, std::placeholders::_1))
    , m_async_ops_count(0)
    , m_selection_follows_mouse(sett().GetMapSelectorFollowsMouse())
    , m_size(0, 0)
    , m_pos(0, 0)
    , m_in_mouse_drag(false)
    , m_mouseover_map(NULL)
    , m_selected_map(NULL)
{
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);
	SetBackgroundColour(*wxLIGHT_GREY);

	m_img_background.Create(MINIMAP_SIZE, MINIMAP_SIZE, false /*don't clear*/);
	wxRect rect(0, 0, MINIMAP_SIZE, MINIMAP_SIZE);
	wxColour color(GetBackgroundColour());
	m_img_background.SetRGB(rect, color.Red(), color.Green(), color.Blue());

	m_img_minimap_alpha = charArr2wxImage(map_select_1_png, sizeof(map_select_1_png));
	m_img_foreground = charArr2wxImage(map_select_2_png, sizeof(map_select_2_png));

	ASSERT_EXCEPTION(m_img_minimap_alpha.HasAlpha(), _T("map_select_1_png must have an alpha channel"));
	ASSERT_EXCEPTION(m_img_foreground.HasAlpha(), _T("map_select_2_png must have an alpha channel"));

	m_img_minimap_loading = wxBitmap(BlendImage(m_img_foreground, m_img_background, false));
}
Esempio n. 8
0
/* SCallTip::SCallTip
 * SCallTip class constructor
 *******************************************************************/
SCallTip::SCallTip(wxWindow* parent)
	: wxPopupWindow(parent),
	col_bg(240, 240, 240),
	col_fg(240, 240, 240),
	function(NULL),
	arg_current(-1),
	switch_args(false),
	btn_mouse_over(0),
	buffer(1000, 1000, 32)
{
	font = GetFont();

	Show(false);

#ifndef __WXOSX__
	SetDoubleBuffered(true);
#endif // !__WXOSX__
	SetBackgroundStyle(wxBG_STYLE_PAINT);

	// Bind events
	Bind(wxEVT_PAINT, &SCallTip::onPaint, this);
	Bind(wxEVT_ERASE_BACKGROUND, &SCallTip::onEraseBackground, this);
	Bind(wxEVT_MOTION, &SCallTip::onMouseMove, this);
	Bind(wxEVT_LEFT_DOWN, &SCallTip::onMouseDown, this);
	Bind(wxEVT_SHOW, &SCallTip::onShow, this);
}
Esempio n. 9
0
StatWin::StatWin( wxWindow *win )
{

    long wstyle = wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR;
#ifndef __WXMAC__
    wstyle |= wxFRAME_SHAPED;
#endif
#ifdef __WXMAC__
    wstyle |= wxSTAY_ON_TOP;
#endif

    wxDialog::Create( win, wxID_ANY, _T(""), wxPoint( 20, 20 ), wxSize( 5, 5 ), wstyle );

    int x, y;
    GetClientSize( &x, &y );

    m_backBrush = wxBrush( GetGlobalColor( _T("UIBDR") ), wxSOLID );

    SetBackgroundColour( GetGlobalColor( _T("UIBDR") ) );

    SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // on WXMSW, this prevents flashing on color scheme change

    m_rows = 1;

    //   Create the Children

    pPiano = new PianoWin( (wxFrame *) this );

}
Esempio n. 10
0
ImagePanel::ImagePanel(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& sz)
{
	// create panel
	Create(parent, id, pos, sz, wxTAB_TRAVERSAL, _T("_imgpanel"));
	// stop auto erase background
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);

	// memorydc for double buffer draw
	wxInt32 iScrW = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, this);
	wxInt32 iScrH = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, this);
	wxBitmap bmp(iScrW, iScrH);
	m_dcMem.SelectObject(bmp);
	m_dcMem.SetBackground(wxBrush(wxColor(0x00606060)));
	m_dcMem.Clear();

	// Event process
	Connect(wxEVT_PAINT, (wxObjectEventFunction)&ImagePanel::OnPaint);
	Connect(wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction)&ImagePanel::OnErase);
	Connect(wxEVT_SIZE, (wxObjectEventFunction)&ImagePanel::OnSize);
	Connect(wxEVT_CONTEXT_MENU, (wxObjectEventFunction)&ImagePanel::OnContextMenu);
	Connect(wxEVT_KILL_FOCUS, (wxObjectEventFunction)&ImagePanel::OnKillFocus);
	// mouse event
	Connect(wxEVT_LEFT_DOWN, (wxObjectEventFunction)&ImagePanel::OnMouseLD);
	Connect(wxEVT_LEFT_UP, (wxObjectEventFunction)&ImagePanel::OnMouseLU);
	Connect(wxEVT_MOTION, (wxObjectEventFunction)&ImagePanel::OnMouseMove);
	// menu or tool-button command
	Connect(ID_CMENU_SAVE, wxEVT_MENU, (wxObjectEventFunction)&ImagePanel::OnCmenuSave);
}
Esempio n. 11
0
LineChartCanvas::LineChartCanvas(wxWindow *parent, TemplateFrame* t_frame,
                                 Project* project, const LineChartStats& lcs_,
                                 LineChartCanvasCallbackInt* lc_canv_cb_,
                                 const wxPoint& pos, const wxSize& size)
: TemplateCanvas(parent, t_frame, project, project->GetHighlightState(), pos,
                 size, false, true),
lcs(lcs_), lc_canv_cb(lc_canv_cb_), summ_avg_circs(4, (GdaCircle*) 0),
y_axis_precision(1)
{
	LOG_MSG("Entering LineChartCanvas::LineChartCanvas");
	shps_orig_xmin = 0;
	shps_orig_ymin = 0;
	shps_orig_xmax = 100;
	shps_orig_ymax = 100;
	UpdateMargins();
	
	use_category_brushes = false;
	
	PopulateCanvas();
	ResizeSelectableShps();
	
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);  // default style
    
    Bind(wxEVT_LEFT_DCLICK, &LineChartCanvas::OnDblClick, this);
    
	LOG_MSG("Exiting LineChartCanvas::LineChartCanvas");
}
Esempio n. 12
0
void wxRibbonBar::CommonInit(long style)
{
    SetName(wxT("wxRibbonBar"));

    m_flags = style;
    m_tabs_total_width_ideal = 0;
    m_tabs_total_width_minimum = 0;
    m_tab_margin_left = 50;
    m_tab_margin_right = 20;
    if ( m_flags & wxRIBBON_BAR_SHOW_TOGGLE_BUTTON )
        m_tab_margin_right += 20;
    if ( m_flags & wxRIBBON_BAR_SHOW_HELP_BUTTON )
        m_tab_margin_right += 20;
    m_tab_height = 20; // initial guess
    m_tab_scroll_amount = 0;
    m_current_page = -1;
    m_current_hovered_page = -1;
    m_tab_scroll_left_button_state = wxRIBBON_SCROLL_BTN_NORMAL;
    m_tab_scroll_right_button_state = wxRIBBON_SCROLL_BTN_NORMAL;
    m_tab_scroll_buttons_shown = false;
    m_arePanelsShown = true;

    if(m_art == NULL)
    {
        SetArtProvider(new wxRibbonDefaultArtProvider);
    }
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);

    m_toggle_button_hovered = false;
    m_bar_hovered = false;

    m_ribbon_state = wxRIBBON_BAR_PINNED;
}
Esempio n. 13
0
bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id,
                                   const wxPoint& pos,
                                   const wxSize& size,
                                   long style,
                                   const wxString& name)
{
    // allow TABbing from one window to the other
    style |= wxTAB_TRAVERSAL;

    if ( !wxWindow::Create(parent, id, pos, size, style, name) )
        return false;

    m_lastSize = GetClientSize();

    m_permitUnsplitAlways = (style & wxSP_PERMIT_UNSPLIT) != 0;

    // FIXME: with this line the background is not erased at all under GTK1,
    //        so temporary avoid it there
#if !defined(__WXGTK__) || defined(__WXGTK20__)
    // don't erase the splitter background, it's pointless as we overwrite it
    // anyhow
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
#endif

    return true;
}
Esempio n. 14
0
SliderPanel::SliderPanel(
	wxWindow* parent, MainFrame *myFrame, wxWindowID id, 
	const wxPoint& pos, const wxSize& size, long style)
	: wxPanel(parent, id, pos, size, style)
{ 
	this->myFrame = myFrame;

	SetBackgroundStyle(wxBG_STYLE_CUSTOM);

	// slider
	wxBitmap bmp1 = wxGetBitmapFromMemory(slider_bmp, 
			sizeof(slider_bmp));
	// back
	wxBitmap bmp2 = wxGetBitmapFromMemory(slider_background_bmp, 
			sizeof(slider_background_bmp));
	// slider hover
	wxBitmap bmp3 = wxGetBitmapFromMemory(slider_hover_bmp, 
			sizeof(slider_hover_bmp));

	m_slider = new GSlider(this, wxID_ANY, wxDefaultPosition, wxNO_BORDER, 
			wxT("aaaa"), bmp2, bmp2, bmp1, bmp3, bmp3, bmp3);

	// default value
	SetRange((float)0, (float)100);
	SetValue((float)0);
}
Esempio n. 15
0
wxMoldeoLineCtrl::wxMoldeoLineCtrl( wxWindow* parent, wxWindowID id, const int value, const int minvalue, const int maxvalue, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name  ) :
wxControl( parent, id,  pos, size, style | wxNO_BORDER, validator, name ) {
    m_min = minvalue;
    m_max = maxvalue;
    m_value = value;
    m_bStartDragging = false;
    m_bLeftSizeDragging = false;
    m_bRightSizeDragging = false;
    m_bMovingDragging = false;
    Mx = 0;
    SetBackgroundStyle(wxBG_STYLE_CUSTOM );

    m_pixel_interval = 500;
    m_play_value = 0;
    m_play_in = 0;
    m_max_play_value = m_max * m_pixel_interval;
    m_play_out = m_max_play_value;
    m_render_in = m_play_in;
    m_render_out = m_play_out;

    //m_timer.SetOwner( this, wxMoldeoLineCtrl::MOLDEOLINETIMER_ID);
	//m_timer.Start(30);

    wxSize screenSize = wxGetDisplaySize();
    bitmap = wxBitmap(screenSize.x, screenSize.y);

    wxScreenDC sdc;
    wxMemoryDC mdc;

    wxPoint AP = ClientToScreen(wxPoint(0,0));
    mdc.SelectObject(bitmap);
    mdc.Blit( 0, 0, screenSize.x, screenSize.y, &sdc, AP.x, AP.y);
    mdc.SelectObject(wxNullBitmap);

}
Esempio n. 16
0
TacticsInstrument::TacticsInstrument(wxWindow *pparent, wxWindowID id, wxString title, int cap_flag)
      :wxControl(pparent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE)
{
      m_title = title;
      m_cap_flag = cap_flag;

      SetBackgroundStyle( wxBG_STYLE_CUSTOM );
      SetDrawSoloInPane(false);
      wxClientDC dc(this);
      int width;
      dc.GetTextExtent(m_title, &width, &m_TitleHeight, 0, 0, g_pFontTitle);

      Connect(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(TacticsInstrument::OnEraseBackground));
      Connect(wxEVT_PAINT, wxPaintEventHandler(TacticsInstrument::OnPaint));
      
      //  On OSX, there is an orphan mouse event that comes from the automatic
      //  exEVT_CONTEXT_MENU synthesis on the main wxWindow mouse handler.
      //  The event goes to an instrument window (here) that may have been deleted by the
      //  preferences dialog.  Result is NULL deref.
      //  Solution:  Handle right-click here, and DO NOT skip()
      //  Strangely, this does not work for GTK...
      //  See: http://trac.wxwidgets.org/ticket/15417
      
#ifdef __WXOSX__
      Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(TacticsInstrument::MouseEvent), NULL, this);
#endif      
}
Esempio n. 17
0
void bmImage::init() {
	SetBackgroundStyle(wxBG_STYLE_PAINT);

	Bind(wxEVT_PAINT, &bmImage::paintEvent, this, -1);
	// Bind(wxEVT_ERASE_BACKGROUND, &bmImage::OnEraseBackground, this, -1);
	Bind(wxEVT_SCROLL_CHANGED, &bmImage::OnScrollChanged, this, -1);
}
bool wxSymbolListCtrl::Create(wxWindow *parent,
                        wxWindowID id,
                        const wxPoint& pos,
                        const wxSize& size,
                        long style,
                        const wxString& name)
{
    style |= wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE;

    if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT)
        style |= wxBORDER_THEME;

    if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) )
        return false;

    // make sure the native widget has the right colour since we do
    // transparent drawing by default
    SetBackgroundColour(GetBackgroundColour());
    m_colBgSel = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);

    // flicker-free drawing requires this
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);

    SetFont(*wxNORMAL_FONT);

    SetupCtrl();

    SetInitialSize(size);

    return true;
}
Esempio n. 19
0
ModelPreview::ModelPreview(wxPanel* parent)
: xlGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize), PreviewModels(NULL), allowSelected(false)
{
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
    virtualWidth = 0;
    virtualHeight = 0;
}
Esempio n. 20
0
WxGraphs::WxGraphs(wxWindow *parent, ConfigManager *cfg) : wxWindow(parent, wxID_ANY) {
	SetHelpText(_T("draw3-base-win"));

	wxFont f = GetFont();
#ifdef __WXGTK__
	f.SetPointSize(f.GetPointSize() - 2);
#endif
	SetFont(f);

#ifndef NO_GSTREAMER
	m_spectrum_vals.resize(24);

	m_dancing = false;
#endif
	m_bg_view = new BackgroundView(this, cfg);

	SetBackgroundStyle(wxBG_STYLE_CUSTOM);

	SetInfoDropTarget* dt = new SetInfoDropTarget(this);
	SetDropTarget(dt);

	m_screen_margins.leftmargin = 36;
	m_screen_margins.rightmargin = 10;
	m_screen_margins.topmargin = 24;
	m_screen_margins.bottommargin = 12;
	m_screen_margins.infotopmargin = 7;

	m_draw_current_draw_name = false;
	
	m_cfg_mgr = cfg;

	/* Set minimal size of widget. */
	SetSizeHints(300, 200);

}
Esempio n. 21
0
ModelPreview::ModelPreview(wxPanel* parent, std::vector<Model*> &models, bool a, int styles)
    : xlGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, styles, ""), PreviewModels(&models), allowSelected(a)
{
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
    virtualWidth = 0;
    virtualHeight = 0;
}
Esempio n. 22
0
DocHistory::DocHistory(CatalystWrapper& cw, int win_id, wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size)
	: wxControl(parent, id, pos, size, wxNO_BORDER|wxWANTS_CHARS|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE),
	  m_catalyst(cw), m_dispatcher(cw.GetDispatcher()), m_doc(cw), m_mdc(), m_bitmap(1,1), m_cell(m_mdc, m_doc), m_hotNode(-1),
	  m_revTooltip(cw)
{
	m_revTooltip.Create(this);
	m_tooltipTimer.SetOwner(this, ID_TOOLTIP_TIMER);
	SetBackgroundStyle(wxBG_STYLE_CUSTOM); // Avoid flicker

	// Initialize variables
	m_needRedrawing = true; // Make sure the ctrl gets drawn on first idle event
	m_document_id = -1;
	m_source_win_id = win_id;
	m_scrollPos = 0;
	m_isScrolling = false;
	m_lineHeight = 18;

	bgBrush = *wxWHITE_BRUSH;
	linePen = *wxGREY_PEN;

	m_pTimeline = new Timeline(this, 2);
	m_pTree = new VersionTree(this, 1);

	// Initialize the memoryDC for dubblebuffering
	m_mdc.SelectObject(m_bitmap);
	m_mdc.SetFont(wxFont(9, wxMODERN, wxNORMAL, wxNORMAL, false));

	// Make sure we recieve notifications of new versions and updates
	m_dispatcher.SubscribeC(wxT("WIN_CHANGEDOC"), (CALL_BACK)OnChangeDoc, this);
	m_dispatcher.SubscribeC(wxT("DOC_UPDATED"), (CALL_BACK)OnDocUpdated, this);
	m_dispatcher.SubscribeC(wxT("DOC_DELETED"), (CALL_BACK)OnDocDeleted, this);
	m_dispatcher.SubscribeC(wxT("DOC_COMMITED"), (CALL_BACK)OnDocCommited, this);
	m_dispatcher.SubscribeC(wxT("DOC_NEWREVISION"), (CALL_BACK)OnNewRevision, this);
	m_dispatcher.SubscribeC(wxT("DOC_UPDATEREVISION"), (CALL_BACK)OnUpdateRevision, this);
}
Esempio n. 23
0
void wxRibbonPanel::CommonInit(const wxString& label, const wxBitmap& icon, long style)
{
    SetName(label);
    SetLabel(label);

    m_minimised_size = wxDefaultSize; // Unknown / none
    m_smallest_unminimised_size = wxDefaultSize;// Unknown / none for IsFullySpecified()
    m_preferred_expand_direction = wxSOUTH;
    m_expanded_dummy = NULL;
    m_expanded_panel = NULL;
    m_flags = style;
    m_minimised_icon = icon;
    m_minimised = false;
    m_hovered = false;
    m_ext_button_hovered = false;

    if(m_art == NULL)
    {
        wxRibbonControl* parent = wxDynamicCast(GetParent(), wxRibbonControl);
        if(parent != NULL)
        {
            m_art = parent->GetArtProvider();
        }
    }

    SetAutoLayout(true);
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
    SetMinSize(wxSize(20, 20));
}
Esempio n. 24
0
bool wxVListBox::Create(wxWindow *parent,
                        wxWindowID id,
                        const wxPoint& pos,
                        const wxSize& size,
                        long style,
                        const wxString& name)
{
#ifdef __WXMSW__
    if ( (style & wxBORDER_MASK) == wxDEFAULT )
        style |= wxBORDER_THEME;
#endif

    style |= wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE;
    if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) )
        return false;

    if ( style & wxLB_MULTIPLE )
        m_selStore = new wxSelectionStore;

    // make sure the native widget has the right colour since we do
    // transparent drawing by default
    SetBackgroundColour(GetBackgroundColour());

    // leave m_colBgSel in an invalid state: it means for OnDrawBackground()
    // to use wxRendererNative instead of painting selection bg ourselves
    m_colBgSel = wxNullColour;

    // flicker-free drawing requires this
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);

    return true;
}
Esempio n. 25
0
CStatusLineCtrl::CStatusLineCtrl(CQueueView* pParent, const t_EngineData* const pEngineData, const wxRect& initialPosition)
	: m_pEngineData(pEngineData)
{
	m_mdc = 0;
	m_pPreviousStatusText = 0;
	m_last_elapsed_seconds = 0;
	m_last_left = 0;
	m_last_bar_split = -1;
	m_last_permill = -1;

	wxASSERT(pEngineData);

#ifdef __WXMSW__
	Create(pParent, wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#else
	Create(pParent->GetMainWindow(), wxID_ANY, initialPosition.GetPosition(), initialPosition.GetSize());
#endif

	SetOwnFont(pParent->GetFont());
	SetForegroundColour(pParent->GetForegroundColour());
	SetBackgroundStyle(wxBG_STYLE_CUSTOM);
	SetBackgroundColour(pParent->GetBackgroundColour());

	m_transferStatusTimer.SetOwner(this);

	m_pParent = pParent;
	m_pStatus = 0;
	m_lastOffset = -1;
	
	m_gcLastTimeStamp = wxDateTime::Now();
	m_gcLastOffset = -1;
	m_gcLastSpeed = -1;

	SetTransferStatus(0);


	// Calculate field widths so that the contents fit under every language.
	if (!m_initialized)
	{
		m_initialized = true;
		wxClientDC dc(this);
		dc.SetFont(GetFont());

		wxCoord w, h;
		wxTimeSpan elapsed(100, 0, 0);
		dc.GetTextExtent(elapsed.Format(_("%H:%M:%S elapsed")), &w, &h);
		m_textHeight = h;
		m_fieldOffsets[0] = 50 + w;

		dc.GetTextExtent(elapsed.Format(_("%H:%M:%S left")), &w, &h);
		m_fieldOffsets[1] = m_fieldOffsets[0] + 20 + w;

		m_fieldOffsets[2] = m_fieldOffsets[1] + 20;
		m_fieldOffsets[3] = m_fieldOffsets[2] + PROGRESSBAR_WIDTH + 20;
	}

#ifdef __WXGTK__
	ResetCursor(this);
#endif
}
wxMoldeoPinCtrl::wxMoldeoPinCtrl( wxWindow* parent, wxWindowID id, const int value, const int minvalue, const int maxvalue, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name  ) :
wxControl( parent, id,  pos, size, style | wxNO_BORDER, validator, name ) {
    m_min = minvalue;
    m_max = maxvalue;
    m_value = value;
    m_bStartDragging = false;
    m_bLeftSizeDragging = false;
    m_bRightSizeDragging = false;
    m_bMovingDragging = false;
    Mx = 0;
    SetBackgroundStyle(wxBG_STYLE_CUSTOM );

    m_pixel_interval = 500;
    m_play_value = 0;
    m_play_in = 0;
    m_max_play_value = m_max * m_pixel_interval;
    m_play_out = m_max_play_value;
    m_render_in = m_play_in;
    m_render_out = m_play_out;

    //m_timer.SetOwner( this, wxMoldeoPinCtrl::MOLDEOPINTIMER_ID);
	//m_timer.Start(30);

	SetDropTarget( new wxPinDropTarget() );


}
EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
                                const wxPoint& pos, const wxSize& size ) :
    wxScrolledWindow( parent, id, pos, size, drawPanelStyle )
{
    wxASSERT( parent );

    ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
    DisableKeyboardScrolling();

    m_scrollIncrementX = std::min( size.x / 8, 10 );
    m_scrollIncrementY = std::min( size.y / 8, 10 );

    SetLayoutDirection( wxLayout_LeftToRight );

    SetBackgroundColour( parent->GetDrawBgColor().ToColour() );

#if KICAD_USE_BUFFERED_DC || KICAD_USE_BUFFERED_PAINTDC
    SetBackgroundStyle( wxBG_STYLE_CUSTOM );
#endif

    m_ClipBox.SetSize( size );
    m_ClipBox.SetX( 0 );
    m_ClipBox.SetY( 0 );
    m_canStartBlock = -1;       // Command block can start if >= 0
    m_abortRequest = false;
    m_enableMousewheelPan = false;
    m_enableZoomNoCenter = false;
    m_enableAutoPan = true;
    m_ignoreMouseEvents = false;
    // Be sure a mouse release button event will be ignored when creating the canvas
    // if the mouse click was not made inside the canvas (can happen sometimes, when
    // launching a editor from a double click made in another frame)
    m_ignoreNextLeftButtonRelease = true;

    m_mouseCaptureCallback = NULL;
    m_endMouseCaptureCallback = NULL;

    Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &m_enableMousewheelPan, false );
    Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
    Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );

    m_requestAutoPan = false;
    m_enableBlockCommands = false;
    m_minDragEventCount = 0;

#ifdef __WXMAC__
    m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
    m_showCrossHair = false;
#else
    m_defaultCursor = m_currentCursor = wxCURSOR_ARROW;
    m_showCrossHair = true;
#endif

    m_cursorLevel = 0;
    m_PrintIsMirrored = false;

    m_ClickTimer = (wxTimer*) NULL;
    m_doubleClickInterval = 250;
}
Esempio n. 28
0
WSortView::WSortView(wxWindow *parent, int id, class WMain_wxg* wmain)
    : wxPanel(parent, id),
      wmain(reinterpret_cast<WMain*>(wmain))
{
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);

    m_stepwise = false;
}
Esempio n. 29
0
void CGradientColorBoard::OnPaint(wxPaintEvent& /*event*/)
{
    SetBackgroundStyle(wxBG_STYLE_PAINT);
    wxAutoBufferedPaintDC dc(this);
    DrawBackGround(&dc);
    
    dc.DrawBitmap(m_drawBmp, 0, 0);
}
Esempio n. 30
0
EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
                                const wxPoint& pos, const wxSize& size ) :
    wxScrolledWindow( parent, id, pos, size, wxBORDER | wxHSCROLL | wxVSCROLL )
{
    wxASSERT( parent );

    ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
    DisableKeyboardScrolling();

    m_scrollIncrementX = std::min( size.x / 8, 10 );
    m_scrollIncrementY = std::min( size.y / 8, 10 );

    SetBackgroundColour( MakeColour( parent->GetDrawBgColor() ) );

#if KICAD_USE_BUFFERED_DC || KICAD_USE_BUFFERED_PAINTDC
    SetBackgroundStyle( wxBG_STYLE_CUSTOM );
#endif

    m_ClipBox.SetSize( size );
    m_ClipBox.SetX( 0 );
    m_ClipBox.SetY( 0 );
    m_canStartBlock = -1;       // Command block can start if >= 0
    m_abortRequest = false;
    m_enableMiddleButtonPan = true;
    m_enableZoomNoCenter = false;
    m_panScrollbarLimits = false;
    m_enableAutoPan = true;
    m_ignoreMouseEvents = false;
    m_ignoreNextLeftButtonRelease = false;

    m_mouseCaptureCallback = NULL;
    m_endMouseCaptureCallback = NULL;

    wxConfigBase* cfg = Kiface().KifaceSettings();

    if( cfg )
    {
        cfg->Read( ENBL_MIDDLE_BUTT_PAN_KEY, &m_enableMiddleButtonPan, true );
        cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
        cfg->Read( MIDDLE_BUTT_PAN_LIMITED_KEY, &m_panScrollbarLimits, false );
        cfg->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );
    }

    m_requestAutoPan = false;
    m_enableBlockCommands = false;
    m_minDragEventCount = 0;

#ifdef __WXMAC__
    m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
    m_showCrossHair = false;
#else
    m_defaultCursor = m_currentCursor = wxCURSOR_ARROW;
    m_showCrossHair = true;
#endif

    m_cursorLevel = 0;
    m_PrintIsMirrored = false;
}