Source: /app/hbasic/hbasic/src/menu_editor.h
|
|
|
|
/* **************************************************************************
File: menu_editor.h
Desc: Memu editor widget.
----------------------------------------------------------------------------
copyright : (C) 2001 HBasic project (Marcus Engels)
***************************************************************************/
/* **************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/* ----------------------------------------------------------------------- */
/* Classlist: List of classes that will be defined in this source file. */
/* ----------------------------------------------------------------------- */
/**
* CMenuEditor : Menu editor dialog for HBasic.
*/
/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file. */
/* Please report with date, maintainer and change description. */
/* ----------------------------------------------------------------------- */
#ifndef MENU_EDITOR_H
#define MENU_EDITOR_H
#include
#include
#include
#include "structs.h"
class QLabel;
class QFrame;
class QHBox;
class QPopupMenu;
class MenuTreeEntry;
class IconTreeEntry;
class HBIcon;
/* ---------------------------------------------------------------------- */
/**
* @short Menu editor dialog that handles menu entries.
*
* This is the widget that handles menu entries in the menu editor window.
*
*/
class CMenuEntryEditor : public QDialog
{
Q_OBJECT
public:
QLabel *lab_header;
QPushButton *btn_quit;
QLineEdit *le_menu_text;
void resizeEvent( QResizeEvent *evt );
CMenuEntryEditor( QWidget *parent=0 );
};
/* ---------------------------------------------------------------------- */
/**
* @short Action editor dialog that handles action entries.
*
* This is the widget that handles action entries in the menu editor window.
*
*/
class CActionEditor : public QDialog
{
Q_OBJECT
public:
IconTreeEntry *icon_entry_ptr;
QLineEdit *le_action_name;
QLineEdit *le_picture_name;
HBIcon *current_selected_icon;
MENU_ACTION *current_action;
void resizeEvent( QResizeEvent *evt );
CActionEditor( QWidget *parent=0, MENU_ACTION *men_ptr = NULL );
private:
QLabel *lab_act_header;
QLabel *lab_pic_header;
QPushButton *btn_quit;
QPushButton *btn_select_pic;
private slots:
void slotQuit( void );
void slotSelectPicture( void );
};
/* ----------------------------------------------------------- */
/**
* @short One entry in the menutree of the menu editor window.
*
* This class handles one entry in the menu editor treeview. It is derived
* from QListViewItem and contains additional information.
*
*/
class MenuTreeEntry : public QListViewItem
{
public:
MenuTreeEntry( MenuTreeEntry *parent, MenuTreeEntry *after,
QString *entry_text, short new_entry_type = 0,
void *new_struct_ptr = NULL );
MenuTreeEntry( QListView *parent, QString entry_text, short new_type );
short entry_type;
void *struct_ptr;
};
/* ----------------------------------------------------------- */
/**
* @short Main widget for the menu editor.
*
* This is the main class for the HBasic menu editor window. It is derived
* from QMainWindow since it should display the menubar or toolbar that
* will be created or changed with the editor functions.
*
*/
class MenuEditorWindow: public QMainWindow
{
Q_OBJECT
public:
MenuEditorWindow( QWidget *parent, MENUTOOLBAR_DESC *new_mtdesc_ptr );
private:
void closeEvent( QCloseEvent* );
void resizeEvent( QResizeEvent *evt );
void createMenu( void );
void createToolbar( void );
MENUTOOLBAR_DESC *mtbar_ptr;
private slots:
void print( void );
void slotRightMousePressed( QListViewItem *new_popup_item, const QPoint &pos, int num);
void slotActionsMousePressed( QListViewItem *new_popup_item, const QPoint &pos, int num);
void createNewMenubar( void );
void createNewToolbar( void );
void createNewMenuItem( void );
void createNewAction( void );
void deleteMenuEntry( void );
void deleteToolbarEntry( void );
void slotConnect( void );
void slotDeleteAction( void );
void slotEditAction( void );
void slotDeleteToolbar( void );
void slotEditToolbar( void );
void slotDeleteMenubar( void );
void slotEditMenubar( void );
void slotMenuActivated( int menu_id );
private:
QFrame *fr_main_frame;
QPushButton *btn_connect;
QPushButton *btn_quit;
QListView *lv_editor;
QListView *lv_actions;
MenuTreeEntry *current_menu_entry;
MenuTreeEntry *current_action_entry;
void createMenuEntries( void );
};
#endif
Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54. |