Example #1
0
uint32
DWindowHWInterface::AvailableHWAcceleration() const
{
	uint32 flags = 0;

	if (!IsDoubleBuffered()) {
		if (fAccScreenBlit)
			flags |= HW_ACC_COPY_REGION;
		if (fAccFillRect)
			flags |= HW_ACC_FILL_REGION;
		if (fAccInvertRect)
			flags |= HW_ACC_INVERT_REGION;
	}

	return flags;
}
Example #2
0
bool wxComboCtrl::Create(wxWindow *parent,
                            wxWindowID id,
                            const wxString& value,
                            const wxPoint& pos,
                            const wxSize& size,
                            long style,
                            const wxValidator& validator,
                            const wxString& name)
{

    // Set border
    long border = style & wxBORDER_MASK;

    if ( !border )
    {
        if ( wxUxThemeIsActive() )
        {
            // For XP, have 1-width custom border, for older version use sunken
            border = wxBORDER_NONE;
            m_widthCustomBorder = 1;
        }
        else
            border = wxBORDER_SUNKEN;

        style = (style & ~(wxBORDER_MASK)) | border;
    }

    // create main window
    if ( !wxComboCtrlBase::Create(parent,
                           id,
                           value,
                           pos,
                           size,
                           style | wxFULL_REPAINT_ON_RESIZE,
                           validator,
                           name) )
        return false;

    if ( wxUxThemeIsActive() && ::wxGetWinVersion() >= wxWinVersion_Vista )
            m_iFlags |= wxCC_BUTTON_STAYS_DOWN |wxCC_BUTTON_COVERS_BORDER;

    if ( style & wxCC_STD_BUTTON )
        m_iFlags |= wxCC_POPUP_ON_MOUSE_UP;

    // Prepare background for double-buffering or better background theme
    // support, whichever is possible.
    SetDoubleBuffered(true);
    if ( !IsDoubleBuffered() )
        SetBackgroundStyle( wxBG_STYLE_PAINT );

    // Create textctrl, if necessary
    CreateTextCtrl( wxNO_BORDER );

    // Add keyboard input handlers for main control and textctrl
    InstallInputHandlers();

    // SetInitialSize should be called last
    SetInitialSize(size);

    return true;
}