UISpecialControls.cpp revision c58f1213e628a545081c70e26c6b67a841cff880
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* VBoxSpecialButtons implementation
*/
/*
* Copyright (C) 2009-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/* VBox includes */
#include "UIIconPool.h"
#include "UISpecialControls.h"
/* Global includes */
#include <QHBoxLayout>
/********************************************************************************
*
* A mini cancel button in the native Cocoa version.
*
********************************************************************************/
{
}
{
}
/********************************************************************************
*
* A rest button in the native Cocoa version.
*
********************************************************************************/
{
}
{
}
/********************************************************************************
*
* A help button in the native Cocoa version.
*
********************************************************************************/
{
}
/********************************************************************************
*
* A segmented button in the native Cocoa version.
*
********************************************************************************/
{
}
{
}
/********************************************************************************
*
* A search field in the native Cocoa version.
*
********************************************************************************/
{
}
#else /* VBOX_DARWIN_USE_NATIVE_CONTROLS */
/* Qt includes */
#include <QPainter>
#include <QBitmap>
#include <QMouseEvent>
#include <QSignalMapper>
/********************************************************************************
*
* A mini cancel button for the other OS's.
*
********************************************************************************/
{
setAutoRaise(true);
}
/********************************************************************************
*
* A help button for the other OS's.
*
********************************************************************************/
/* From: src/gui/styles/qmacstyle_mac.cpp */
static const int PushButtonLeftOffset = 6;
static const int PushButtonTopOffset = 4;
static const int PushButtonRightOffset = 12;
static const int PushButtonBottomOffset = 4;
{
#ifdef Q_WS_MAC
m_pButtonPressed = false;
#endif /* Q_WS_MAC */
/* Applying language settings */
}
{
/* Applying language settings */
}
void UIHelpButton::retranslateUi()
{
}
#ifdef Q_WS_MAC
{
delete m_pNormalPixmap;
delete m_pPressedPixmap;
delete m_pMask;
}
{
}
{
painter.drawPixmap(PushButtonLeftOffset, PushButtonTopOffset, m_pButtonPressed ? *m_pPressedPixmap: *m_pNormalPixmap);
}
{
else
return false;
}
{
m_pButtonPressed = true;
update();
}
{
m_pButtonPressed = false;
update();
}
{
m_pButtonPressed = false;
update();
}
#endif /* Q_WS_MAC */
/********************************************************************************
*
* A segmented button for the other OS's.
*
********************************************************************************/
{
m_pSignalMapper = new QSignalMapper(this);
for (int i=0; i < aCount; ++i)
{
button->setAutoRaise(true);
}
}
{
delete m_pSignalMapper;
}
{
}
{
}
{
}
{
}
{
}
{
for (int i=0; i < m_pButtons.size(); ++i)
{
}
}
/********************************************************************************
*
* A search field for the other OS's.
*
********************************************************************************/
{
}
void UISearchField::markError()
{
c.setAlphaF(0.3);
}
void UISearchField::unmarkError()
{
}
#endif /* VBOX_DARWIN_USE_NATIVE_CONTROLS */