You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
137 lines
4.4 KiB
137 lines
4.4 KiB
15 years ago
|
/*
|
||
|
* Copyright (c) 2002-2003 Jesper K. Pedersen <blackie@kde.org>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License version 2 as published by the Free Software Foundation.
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
**/
|
||
|
// ------------------------------- Description ----------------------------
|
||
|
// This is the KMultiFormListBox Widget. You do not need to inheret from this class,
|
||
|
// your interface to it will be through the methods `append` and `elements'.
|
||
|
//
|
||
|
// To make an instance of the widget, you need to inherit the classes
|
||
|
// `KMultiFormListBoxFactory' and `KMultiFormListBoxEntry'.
|
||
|
// ------------------------------------------------------------------------
|
||
12 years ago
|
#ifndef __tdemultiformlistboxmultivisble
|
||
|
#define __tdemultiformlistboxmultivisble
|
||
15 years ago
|
|
||
|
// -------------------------------- includes ------------------------------
|
||
12 years ago
|
#include "tdemultiformlistbox.h"
|
||
15 years ago
|
//-------------------------------------------------------------------------
|
||
|
|
||
|
/**
|
||
|
@internal
|
||
|
*/
|
||
15 years ago
|
class KMultiFormListBoxMultiVisible :public TQScrollView, KMultiFormListBoxShower {
|
||
15 years ago
|
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
friend class KMultiFormListBox;
|
||
|
|
||
|
private:
|
||
|
/**
|
||
|
@param factory A factory used to generate the instances of KMultiFormListBoxEntry
|
||
|
class which is repeated in the KMultiFormListBox
|
||
13 years ago
|
@param parent A pointer to the parent widget
|
||
15 years ago
|
*/
|
||
13 years ago
|
KMultiFormListBoxMultiVisible(KMultiFormListBoxFactory *factory, TQWidget *parent = 0, const char *name = 0);
|
||
15 years ago
|
|
||
|
/**
|
||
|
@return The elements in the KMultiFormListBox
|
||
|
*/
|
||
|
KMultiFormListBoxEntryList elements();
|
||
|
void append(KMultiFormListBoxEntry *);
|
||
|
|
||
15 years ago
|
TQWidget* qWidget() { return this; }
|
||
15 years ago
|
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
/**
|
||
|
This slot should be connected to a button which lets the user know that
|
||
|
he may get more elements in this KMultiFormListBox by pressing it.
|
||
|
The button should be labeled ``More Entries'' or something similar.
|
||
|
*/
|
||
|
void addElement(); // Adds an empty element to the KMultiFormListBox
|
||
|
|
||
|
|
||
|
protected slots:
|
||
|
|
||
|
/**
|
||
|
When this slot is invoked then the Idx menu will be shown.
|
||
|
@param elm The KMultiFormListBoxEntry element where the Idx button was
|
||
|
pressed. This information is necessary to be able to calculate the
|
||
|
location where the drop down menu should be shown
|
||
|
*/
|
||
|
void showIndexList(KMultiFormListBoxEntry *elm);
|
||
|
|
||
|
protected:
|
||
|
/**
|
||
|
Copies the element pointed to by which to the clipboard and removes it
|
||
|
from the interface.
|
||
|
This function is accessed from the class @ref CCP.
|
||
|
@param which A pointer to the element to cut.
|
||
|
*/
|
||
|
void cut(KMultiFormListBoxEntry *which);
|
||
|
|
||
|
/**
|
||
|
Copies the element pointed to by which to the clipboard.
|
||
|
This function is accessed from the class @ref CCP.
|
||
|
@param which A pointer to the element to copied.
|
||
|
*/
|
||
|
void copy(KMultiFormListBoxEntry *which);
|
||
|
|
||
|
/**
|
||
|
Paste the element from the clipboard to the KMultiFormListBox
|
||
|
This function is accessed from the class @ref CCP.
|
||
|
@param which A pointer to the KMultiFormListBoxEntry element which the
|
||
|
clipboard element should be inserted before,.
|
||
|
*/
|
||
|
void paste(KMultiFormListBoxEntry *which);
|
||
|
|
||
|
/**
|
||
|
Inserts an empty KMultiFormListBoxEntry into the widget.
|
||
|
@param which A pointer to the element which the new empty widget
|
||
|
should be inserted before.
|
||
|
*/
|
||
|
|
||
|
void addElement(KMultiFormListBoxEntry *);
|
||
|
|
||
|
friend class CCP;
|
||
|
|
||
15 years ago
|
virtual void resizeEvent(TQResizeEvent *);
|
||
|
void addElemBefore(KMultiFormListBoxEntry *newElm, TQWidget *existing);
|
||
15 years ago
|
void insertElmIntoWidget(KMultiFormListBoxEntry *elm, KMultiFormListBoxEntry *after);
|
||
|
void showWidget(KMultiFormListBoxEntry *elm);
|
||
15 years ago
|
void delElement(TQWidget *);
|
||
15 years ago
|
void delAnElement();
|
||
|
void addElemBefore(KMultiFormListBoxEntry *newElm, KMultiFormListBoxEntry *existing);
|
||
|
void updateClipperContent();
|
||
|
int countElements(WidgetList *);
|
||
|
|
||
|
|
||
|
|
||
|
private:
|
||
|
// Instance variables
|
||
|
|
||
|
KMultiFormListBoxFactory *factory;
|
||
|
WidgetList *elms;
|
||
15 years ago
|
TQPushButton *addBut;
|
||
|
TQByteArray clipboard;
|
||
15 years ago
|
};
|
||
|
|
||
|
|
||
12 years ago
|
#endif /* tdemultiformlistboxmultivisble */
|
||
15 years ago
|
|