コード例 #1
0
WinEDA_DrawPanel::WinEDA_DrawPanel(WinEDA_DrawFrame *parent, int id,
						const wxPoint& pos, const wxSize& size):
		EDA_DRAW_PANEL(parent, id, pos, size,
		wxBORDER|wxNO_FULL_REPAINT_ON_RESIZE)
{
	m_Parent = parent;
	m_Ident = m_Parent->m_Ident;
	m_Scroll_unit = 1;
	m_ScrollButt_unit = 40;
	SetBackgroundColour(wxColour(ColorRefs[g_DrawBgColor].m_Red,
						ColorRefs[g_DrawBgColor].m_Green,
						ColorRefs[g_DrawBgColor].m_Blue ) );
	EnableScrolling(TRUE,TRUE);
	m_ClipBox.SetSize(size);
	m_ClipBox.SetX(0);
	m_ClipBox.SetY(0);
	m_CanStartBlock = -1;	// Command block can start if >= 0
	m_AbortEnable = m_AbortRequest = FALSE;
	m_AutoPAN_Enable = TRUE;
	m_IgnoreMouseEvents = FALSE;

	if ( m_Parent->m_Parent->m_EDA_Config )
		m_AutoPAN_Enable = m_Parent->m_Parent->m_EDA_Config->Read(wxT("AutoPAN"), TRUE);
	m_AutoPAN_Request = FALSE;
	m_Block_Enable = FALSE;
	m_PanelDefaultCursor = m_PanelCursor = wxCURSOR_ARROW;
	m_CursorLevel = 0;
}
コード例 #2
0
CGridSampleLimits::CGridSampleLimits(wxWindow *parent, wxWindowID id) :
  _CGridEdit(parent,id), 
  m_pValidatePct(NULL), 
  m_pData(NULL),
  m_pMessageBook(NULL)
  //,m_bReadOnly(false)
{
  wxString PEAKS(_T("peaks"));
  CreateGrid(ROW_MESSAGE_BOOK_OFFSET,2);
  EnableDragColSize(false);
  EnableDragRowSize(false);

  EnableScrolling(false,true);

  SetRowLabelValue(ROW_PULLUP,_T("Max. No. of pullups peaks per sample"));
  SetCellValue(ROW_PULLUP,1,PEAKS);

  SetRowLabelValue(ROW_STUTTER,_T("Max. No. of stutter peaks per sample"));
  SetCellValue(ROW_STUTTER,1,PEAKS);

  SetRowLabelValue(ROW_ADENYLATION,_T("Max. No. of adenylation peaks per sample"));
  SetCellValue(ROW_ADENYLATION,1,PEAKS);

  SetRowLabelValue(ROW_OFF_LADDER,_T("Max. off-ladder alleles per sample:"));
  SetCellValue(ROW_OFF_LADDER,1,PEAKS);
  
  SetRowLabelValue(ROW_RESIDUAL,_T("Max. residual for allele (<0.5 bp):"));
  SetCellValue(ROW_RESIDUAL,1,_T("Sample/Ladder BP alignment"));
  SetCellEditor(ROW_RESIDUAL,0,new wxGridCellFloatEditor(-1,4));
  SetDefaultCellValidator(new nwxGridCellUIntRangeValidator(0,1000000,true));
  SetCellValidator(
    new nwxGridCellDoubleRangeValidator(0.0,0.5,true),
    ROW_RESIDUAL,0);
  
  SetRowLabelValue(ROW_EXCESSIVE_RESIDUAL,_T("Max. No. of peaks with excessive residual:"));
  SetCellValue(ROW_EXCESSIVE_RESIDUAL,1,PEAKS);

  SetRowLabelValue(ROW_RFU_INCOMPLETE_SAMPLE,_T("Incomplete profile threshold for Reamp More/Reamp Less:"));
  SetCellValue(ROW_RFU_INCOMPLETE_SAMPLE,1,_T("RFU"));

  SetRowLabelValue(ROW_MIN_BPS_ARTIFACTS,_T("Ignore artifacts smaller than:"));
  SetCellValue(ROW_MIN_BPS_ARTIFACTS,1,_T("bps"));
  m_clrBackground = GetLabelBackgroundColour();
  wxFont fnLabel = GetLabelFont();
  for(int nRow = 0; nRow < ROW_MESSAGE_BOOK_OFFSET; nRow++)
  {
    SetCellBackgroundColour(nRow,1,m_clrBackground);
    SetReadOnly(nRow,1,true);
    SetCellFont(nRow,1,fnLabel);
    SetCellAlignment(nRow,0,wxALIGN_RIGHT, wxALIGN_CENTRE);
  }
  SetDefaultEditor(new wxGridCellFloatEditor(1,0));
  SetColLabelValue(0,_T("Value"));
  SetColLabelValue(1,_T("Units"));
  SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
  SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE);
}
コード例 #3
0
EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
                                        const wxPoint& aPosition, const wxSize& aSize,
                                        GAL_TYPE aGalType ) :
    wxScrolledCanvas( aParentWindow, aWindowId, aPosition, aSize )
{
    m_parent     = aParentWindow;
    m_edaFrame   = dynamic_cast<EDA_DRAW_FRAME*>( aParentWindow );
    m_gal        = NULL;
    m_backend    = GAL_TYPE_NONE;
    m_view       = NULL;
    m_painter    = NULL;
    m_eventDispatcher = NULL;
    m_lostFocus  = false;

    SetLayoutDirection( wxLayout_LeftToRight );

    SwitchBackend( aGalType );
    SetBackgroundStyle( wxBG_STYLE_CUSTOM );
    
// Scrollbars broken in GAL on OSX
#ifdef __WXMAC__
    ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
#else
    ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
#endif
    EnableScrolling( false, false );    // otherwise Zoom Auto disables GAL canvas

    m_painter = new KIGFX::PCB_PAINTER( m_gal );

    m_view = new KIGFX::VIEW( true );
    m_view->SetPainter( m_painter );
    m_view->SetGAL( m_gal );

    Connect( wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), NULL, this );
    Connect( wxEVT_ENTER_WINDOW, wxEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), NULL, this );
    Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( EDA_DRAW_PANEL_GAL::onLostFocus ), NULL, this );

    const wxEventType events[] =
    {
        wxEVT_LEFT_UP, wxEVT_LEFT_DOWN, wxEVT_LEFT_DCLICK,
        wxEVT_RIGHT_UP, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_DCLICK,
        wxEVT_MIDDLE_UP, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_DCLICK,
        wxEVT_MOTION, wxEVT_MOUSEWHEEL, wxEVT_CHAR,
#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
        wxEVT_MAGNIFY,
#endif
        KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE
    };

    BOOST_FOREACH( wxEventType eventType, events )
    {
        Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ),
                 NULL, m_eventDispatcher );
    }
コード例 #4
0
ファイル: chartpanel.cpp プロジェクト: lukecian/wxfreechart
wxChartPanel::wxChartPanel(wxWindow *parent, wxWindowID id, Chart *chart, const wxPoint &pos, const wxSize &size)
    : wxScrolledWindow(parent, id, pos, size, wxHSCROLL | wxVSCROLL | wxFULL_REPAINT_ON_RESIZE)
{
    SetBackgroundStyle(wxBG_STYLE_CUSTOM);
    EnableScrolling(false, false);

    m_chart = NULL;
    m_antialias = false;

    ResizeBackBitmap(size);

    SetScrollRate(1, 1);
    SetChart(chart);
}
コード例 #5
0
ファイル: console_panel.cpp プロジェクト: Ehnonymoose/MSE
	MessageCtrl(wxWindow* parent, int id)
		: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME_FIX(wxBORDER_THEME))
	{
		SetBackgroundStyle(wxBG_STYLE_CUSTOM);
		SetScrollRate(0, 1);
		EnableScrolling(false,true);
		// icons
		BOOST_STATIC_ASSERT(MESSAGE_TYPE_MAX == 6);
		icons[MESSAGE_INPUT]   = wxBitmap(load_resource_image(_("message_input")));
		icons[MESSAGE_OUTPUT]  = wxBitmap();
		icons[MESSAGE_INFO]    = wxBitmap(load_resource_image(_("message_information")));
		icons[MESSAGE_WARNING] = wxBitmap(load_resource_image(_("message_warning")));
		icons[MESSAGE_ERROR]   = wxBitmap(load_resource_image(_("message_error")));
		icons[MESSAGE_FATAL_ERROR] = icons[MESSAGE_ERROR];
		// color
		colors[MESSAGE_INPUT]   = wxColour(0,80,0);
		colors[MESSAGE_OUTPUT]  = wxColour(255,255,255);
		colors[MESSAGE_INFO]    = wxColour(0,0,255);
		colors[MESSAGE_WARNING] = wxColour(255,255,0);
		colors[MESSAGE_ERROR]   = colors[MESSAGE_FATAL_ERROR] = wxColour(255,0,0);
	}
コード例 #6
0
ファイル: gui.cpp プロジェクト: ekumlin/Cubyx-IRC
//cWindowOutputCtrl::cWindowOutputCtrl(wxWindow *Parent, wxWindowID ID, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : wxRichTextCtrl(Parent,ID,value,pos,size,style,validator,name) {
cWindowOutputCtrl::cWindowOutputCtrl(wxWindow *Parent, wxWindowID ID, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxHtmlWindow(Parent,ID,pos,size,style,name) {
    EnableScrolling(false,true);
    int FontSizes[7] = {6,8,10,12,14,16,18};
    SetFonts(GUI->m_Font->GetFaceName(),GUI->m_Font->GetFaceName(),FontSizes);
    AppendToPage("<font style='background-color: #333333'>ABC</font>");
}
コード例 #7
0
EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
                                        const wxPoint& aPosition, const wxSize& aSize,
                                        GAL_TYPE aGalType ) :
    wxScrolledCanvas( aParentWindow, aWindowId, aPosition, aSize )
{
    m_parent     = aParentWindow;
    m_edaFrame   = dynamic_cast<EDA_DRAW_FRAME*>( aParentWindow );
    m_gal        = NULL;
    m_backend    = GAL_TYPE_NONE;
    m_view       = NULL;
    m_painter    = NULL;
    m_eventDispatcher = NULL;
    m_lostFocus  = false;

    SetLayoutDirection( wxLayout_LeftToRight );

    SwitchBackend( aGalType );
    SetBackgroundStyle( wxBG_STYLE_CUSTOM );

// Scrollbars broken in GAL on OSX
#ifdef __WXMAC__
    ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
#else
    ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
#endif
    EnableScrolling( false, false );    // otherwise Zoom Auto disables GAL canvas

    m_painter = new KIGFX::PCB_PAINTER( m_gal );

    m_view = new KIGFX::VIEW( true );
    m_view->SetPainter( m_painter );
    m_view->SetGAL( m_gal );

    Connect( wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), NULL, this );
    Connect( wxEVT_ENTER_WINDOW, wxEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), NULL, this );
    Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( EDA_DRAW_PANEL_GAL::onLostFocus ), NULL, this );

    const wxEventType events[] =
    {
        wxEVT_LEFT_UP, wxEVT_LEFT_DOWN, wxEVT_LEFT_DCLICK,
        wxEVT_RIGHT_UP, wxEVT_RIGHT_DOWN, wxEVT_RIGHT_DCLICK,
        wxEVT_MIDDLE_UP, wxEVT_MIDDLE_DOWN, wxEVT_MIDDLE_DCLICK,
        wxEVT_MOTION, wxEVT_MOUSEWHEEL, wxEVT_CHAR,
#if wxCHECK_VERSION( 3, 1, 0 ) || defined( USE_OSX_MAGNIFY_EVENT )
        wxEVT_MAGNIFY,
#endif
        KIGFX::WX_VIEW_CONTROLS::EVT_REFRESH_MOUSE
    };

    for( wxEventType eventType : events )
    {
        Connect( eventType, wxEventHandler( EDA_DRAW_PANEL_GAL::onEvent ),
                 NULL, m_eventDispatcher );
    }

    // View controls is the first in the event handler chain, so the Tool Framework operates
    // on updated viewport data.
    m_viewControls = new KIGFX::WX_VIEW_CONTROLS( m_view, this );

    m_pendingRefresh = false;
    m_drawing = false;
    m_drawingEnabled = false;

    // Set up timer that prevents too frequent redraw commands
    m_refreshTimer.SetOwner( this );
    Connect( m_refreshTimer.GetId(), wxEVT_TIMER,
            wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onRefreshTimer ), NULL, this );

    // Set up timer to execute OnShow() method when the window appears on the screen
    m_onShowTimer.SetOwner( this );
    Connect( m_onShowTimer.GetId(), wxEVT_TIMER,
            wxTimerEventHandler( EDA_DRAW_PANEL_GAL::onShowTimer ), NULL, this );
    m_onShowTimer.Start( 10 );

    LoadGalSettings();
}
コード例 #8
0
ファイル: MorphanPanel.cpp プロジェクト: TricksterGuy/Morphan
MorphanPanel::MorphanPanel(wxWindow* Parent, wxWindowID Id, const wxPoint& Position, const wxSize& Size, long Style) :
    wxScrolledCanvas(Parent, Id, Position, Size, Style), view(NULL)
{
    EnableScrolling(true, true);
    SetScrollRate(1, 1);
}