Esempio n. 1
0
/** Should the inactive LEDs be drawn */
void wxLEDPanel::ShowInactivLEDs(bool show_inactivs)
{
    if(m_show_inactivs==show_inactivs) return;

    m_show_inactivs=show_inactivs;
    PrepareBackground();
}
Esempio n. 2
0
/** Swaps the LED states
* @param invert if true, all active LEDs are drawn as inactiv and all inactiv drawn as activ
*/
void wxLEDPanel::ShowInvertet(bool invert)
{
    if(m_invert==invert) return;

    m_invert=invert;
    PrepareBackground();
}
Esempio n. 3
0
/**
* Sets the colour of the LEDs
* @param colourID the ID of the new colour
*/
void wxLEDPanel::SetLEDColour(wxLEDColour colourID)
{
	// for drawing
	wxBrush brush;
	wxPen pen;

	// colourID speichern
	m_activ_colour_id=colourID;

	int w=m_ledsize.GetWidth()+m_padding;
	int h=m_ledsize.GetHeight()+m_padding;

	// create Bitmaps for "LED on" und "LED off"
	wxBitmap led_on(w,h);
	wxBitmap led_off(w,h);
	wxBitmap led_none(w,h);

	// draw "LED on"
	m_mdc_led_on.SelectObject(led_on);

	// Clear Background
	m_mdc_led_on.SetBackground(this->GetBackgroundColour());
    m_mdc_led_on.Clear();

	// complete point
    pen.SetColour(s_colour_dark[colourID-1]);
    brush.SetColour(s_colour[colourID-1]);
    m_mdc_led_on.SetPen(pen);
    m_mdc_led_on.SetBrush(brush);
    m_mdc_led_on.DrawEllipse(wxPoint(0,0),m_ledsize);

	// left top corner in lighter colour
	pen.SetColour(s_colour_light[colourID-1]);
	m_mdc_led_on.SetPen(pen);
	m_mdc_led_on.DrawEllipticArc(0,0,m_ledsize.GetWidth(),m_ledsize.GetHeight(),75.0,195.0);


	// draw "LED off"
	m_mdc_led_off.SelectObject(led_off);

	// cleare Background
	m_mdc_led_off.SetBackground(this->GetBackgroundColour());
    m_mdc_led_off.Clear();

    // complete point
    pen.SetColour(s_colour_dark[colourID-1]);
    brush.SetColour(s_colour_verydark[colourID-1]);
    m_mdc_led_off.SetPen(pen);
    m_mdc_led_off.SetBrush(brush);
    m_mdc_led_off.DrawEllipse(wxPoint(0,0),m_ledsize);


    // draw "no LED"
    m_mdc_led_none.SelectObject(led_none);
	m_mdc_led_none.SetBackground(this->GetBackgroundColour());
    m_mdc_led_none.Clear();


    PrepareBackground();
}
Esempio n. 4
0
/** Overwritten to prepare the background with the new backgroundcolour
* @param colour the new backroundcolour
*/
bool wxLEDPanel::SetBackgroundColour(const wxColour& colour)
{
    if (wxWindow::SetBackgroundColour(colour))
    {
      PrepareBackground();
      return true;
    }

    return false;
}
Esempio n. 5
0
C_LineEdit::C_LineEdit()
{
    _nbCaractMax = 255;

    _hasFocus = false;
    _writeMAJ = false;

    _sfText.SetColor(sf::Color::Black);
    _sfText.SetSize(15.0f);

    PrepareBackground();
}
Esempio n. 6
0
void CFileManagerDlg::OnSize(UINT nType, int cx, int cy)
{
  CDialogEx::OnSize(nType, cx, cy);

  if (nType == SIZE_MAXIMIZED)
    m_bMaximized = TRUE;
  else// if (nType == SIZE_RESTORED)
    m_bMaximized = FALSE;

  ArrangeControls();

  PrepareBackground();

  Invalidate();
}
Esempio n. 7
0
void wxOwnerDrawnComboBox::OnDrawBackground(wxDC& dc,
                                            const wxRect& rect,
                                            int WXUNUSED(item),
                                            int flags) const
{
    // We need only to explicitly draw background for items
    // that should have selected background. Also, call PrepareBackground
    // always when painting the control so that clipping is done properly.

    if ( (flags & wxODCB_PAINTING_SELECTED) ||
         ((flags & wxODCB_PAINTING_CONTROL) && HasFlag(wxCB_READONLY)) )
    {
        int bgFlags = wxCONTROL_SELECTED;

        if ( !(flags & wxODCB_PAINTING_CONTROL) )
            bgFlags |= wxCONTROL_ISSUBMENU;

        PrepareBackground(dc, rect, bgFlags);
    }
}
Esempio n. 8
0
void C_LineEdit::resize(const float x, const float y)
{
    C_Widget::resize(x, y);
    PrepareBackground();
}