Back to index

scribus-ng  1.3.4.dfsg+svn20071115
sccombobox.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /*
00008  *  sccombobox.h
00009  *  ScribusCVS
00010  *
00011  *  Created by Andreas Vox on 01.10.05.
00012  *  Copyright 2005 under GPL2. All rights reserved.
00013  *
00014  */
00015 
00016 #include <qlistbox.h>
00017 #include "sccombobox.h"
00018 
00019 #ifdef QT_MAC
00020 
00021 #include <qmacstyle_mac.h>
00022 
00024 class ScMacStyle : public QMacStyle {
00025        virtual int ScMacStyle::styleHint(StyleHint sh, const QWidget * w, 
00026                                          const QStyleOption & so, 
00027                                          QStyleHintReturn * r) const
00028        {
00029               return sh != QStyle::SH_ComboBox_Popup && QMacStyle::styleHint(sh, w, so, r); 
00030        }
00031 };
00032 #endif
00033 
00034 ScComboBox::ScComboBox( QWidget* parent, const char* name ) : QComboBox(false, parent, name) 
00035 {
00036 #ifdef QT_MAC
00037        setStyle( new ScMacStyle );
00038 #endif
00039        setListBox( new QListBox( this, "in-combo", WType_Popup ) );
00040 }
00041 
00042 ScComboBox::ScComboBox( bool rw, QWidget* parent, const char* name ) :QComboBox(rw, parent, name)
00043 {
00044 #ifdef QT_MAC
00045        setStyle( new ScMacStyle );
00046 #endif
00047        setListBox( new QListBox( this, "in-combo", WType_Popup ) );
00048 }