Exemplo n.º 1
0
LayerButton::LayerButton(const QString &text, QWidget *parent)
    : QPushButton(text, parent) {
  setToggleButton(true);
  setOn(true);
  setMaximumWidth(LayerButton::btnSize());
  setMaximumHeight(LayerButton::btnSize());
}
Exemplo n.º 2
0
// the button class
QWhatsThisPrivate::Button::Button( QWidget * parent, const char * name )
    : QToolButton( parent, name )
{
    QPixmap p( button_image );
    setPixmap( p );
    setToggleButton( TRUE );
    wt->buttons->insert( (void *)this, this );
}
Exemplo n.º 3
0
void QRadioButton::init()
{
    setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
    setToggleButton( TRUE );
    if ( parentWidget() && parentWidget()->inherits("QButtonGroup") ) {
	QButtonGroup *bgrp = (QButtonGroup *)parentWidget();
	bgrp->setRadioButtonExclusive( TRUE );
    }
}
Exemplo n.º 4
0
LayerButton::LayerButton(const QString& text, QWidget* parent)
: QPushButton(text, parent)
{
	int btn_size = 20;

	setToggleButton(true);
	setOn(true);
	setMaximumWidth(btn_size);
	setMaximumHeight(btn_size);
}
Exemplo n.º 5
0
AppletHandleButton::AppletHandleButton(AppletHandle *parent)
  : QPushButton(parent),
    m_parent(parent)
{
    setBackgroundOrigin( AncestorOrigin );
    m_moveMouse = false;
    setFocusPolicy( NoFocus );
    setToggleButton( true );
    setToggleType(QButton::Toggle);
}
Exemplo n.º 6
0
JumpButton::JumpButton( const QString &firstChar, const QString &lastChar,
                        QWidget *parent )
  : QPushButton( "", parent ), mChar( firstChar )
{
  setToggleButton( true );
  if ( !lastChar.isEmpty() )
    setText( QString( "%1 - %2" ).arg( firstChar.upper() ).arg( lastChar.upper() ) );
  else
    setText( firstChar.upper() );
}
Exemplo n.º 7
0
FontButton::FontButton (QWidget *w, QFont &f) : QPushButton (w)
{
    font = f;
    QObject::connect(this, SIGNAL(clicked()), this, SLOT(fontDialog()));
    setMaximumHeight(25);
    setToggleButton(FALSE);
    setFontButton();
    setText(tr("Font"));
    changed = FALSE;
}
KMultiTabBarTab::KMultiTabBarTab(const QPixmap& pic, const QString& text,
		int id,QWidget *parent,KMultiTabBar::KMultiTabBarPosition pos,
		KMultiTabBar::KMultiTabBarStyle style)
	:KMultiTabBarButton(text,0,id,parent,pos,style),
 	m_showActiveTabText(false)
{
	d=new KMultiTabBarTabPrivate();
	setIcon(pic);
	m_expandedSize=24;
	setToggleButton(true);
}
Exemplo n.º 9
0
ColorButton::ColorButton (QWidget *w, QColor &c) : QPushButton (w)
{
  color = c;
  QObject::connect(this, SIGNAL(clicked()), this, SLOT(colorDialog()));
  setMaximumHeight(25);
  setToggleButton(FALSE);
  pix.resize(50, 10);
  setToggleType(SingleShot);
  readonly = FALSE;
  changed = FALSE;
}
Exemplo n.º 10
0
DesktopButton::DesktopButton(QWidget *parent) : PanelButton(parent, "DesktopButton")
{
    setToggleButton(true);

    QToolTip::add(this, i18n("Show desktop"));
    setTitle(i18n("Desktop Access"));
    setIcon("desktop");

    connect(this, SIGNAL(toggled(bool)), this, SLOT(showDesktop(bool)));
    connect(ShowDesktop::the(), SIGNAL(desktopShown(bool)), this, SLOT(toggle(bool)));

    setOn(ShowDesktop::the()->desktopShowing());
}
Exemplo n.º 11
0
FileButton::FileButton (QWidget *w, QStringList &l, QString &p) : QPushButton (w)
{
  QObject::connect(this, SIGNAL(clicked()), this, SLOT(fileDialog()));
  setMaximumHeight(25);
  setToggleButton(FALSE);
  fileList = l;

  path = QDir::homeDirPath();
  if (p.length())
    path = p;

  updateButtonText();
}
Exemplo n.º 12
0
void VCButton::init()
{
  setToggleButton(true);

  assert(m_keyBind == NULL);
  m_keyBind = new KeyBind();

  connect(m_keyBind, SIGNAL(pressed()), this, SLOT(pressFunction()));
  connect(m_keyBind, SIGNAL(released()), this, SLOT(releaseFunction()));

  QToolTip::add(this, "No function");

  setMinimumSize(20, 20);
  resize(30, 30);

  connect(_app, SIGNAL(modeChanged()), this, SLOT(slotModeChanged()));
}
Exemplo n.º 13
0
void VCButton::copyFrom(VCButton* button)
{
  attachFunction(button->m_functionID);

  m_resizeMode = false;

  assert(button->keyBind());
  if (m_keyBind)
    {
      disconnect(m_keyBind);
      delete m_keyBind;
    }

  m_keyBind = new KeyBind(button->keyBind());
  connect(m_keyBind, SIGNAL(pressed()), this, SLOT(pressFunction()));
  connect(m_keyBind, SIGNAL(released()), this, SLOT(releaseFunction()));

  setToggleButton(true);

  setCaption(button->caption());

  if (button->ownFont())
    {
      setFont(button->font());
    }

  if (button->ownPalette())
    {
      setPaletteForegroundColor(button->paletteForegroundColor());
      setPaletteBackgroundColor(button->paletteBackgroundColor());
    }

  if (button->paletteBackgroundPixmap())
    {
      setPaletteBackgroundPixmap(*button->paletteBackgroundPixmap());
    }

  reparent(button->parentWidget(), 0, QPoint(0, 0), true);

  setGeometry(button->geometry());

  move(button->x() + button->width(), button->y());
}
ZLQtToolButton::ZLQtToolButton(ZLQtApplicationWindow &window, ZLToolbar::AbstractButtonItem &item) : QToolButton(window.myToolBar), myWindow(window), myItem(item) {
	static std::string imagePrefix = ZLibrary::ApplicationImageDirectory() + ZLibrary::FileNameDelimiter;
	QPixmap icon((imagePrefix + myItem.iconName() + ".png").c_str());
	setIconSet(QIconSet(icon));
	QSize size = icon.size();
	QIconSet::setIconSize(QIconSet::Large, size);
	QIconSet::setIconSize(QIconSet::Small, size);
	if (item.type() == ZLToolbar::Item::TOGGLE_BUTTON) {
		setToggleButton(true);
	} else if (item.type() == ZLToolbar::Item::MENU_BUTTON) {
		ZLToolbar::MenuButtonItem &menuButtonItem = (ZLToolbar::MenuButtonItem&)myItem;
		shared_ptr<ZLPopupData> popupData = menuButtonItem.popupData();
		myWindow.myPopupIdMap[&menuButtonItem] =
			!popupData ? (size_t)-1 : (popupData->id() - 1);
		setPopup(new ZLQtPopupMenu(this));
	}
	QString text = QString::fromUtf8(myItem.tooltip().c_str());
	setTextLabel(text);
	setUsesTextLabel(false);
	QToolTip::add(this, text);
	connect(this, SIGNAL(clicked()), this, SLOT(onActivated()));
}
Exemplo n.º 15
0
KFinderButton::KFinderButton( const char *_text, KFinder *_finder ) : QPushButton( _text, _finder )
{
    connect( this, SIGNAL( pressed() ), this, SLOT( slotPressed() ) );
    setToggleButton( TRUE );
}