1
//=============================================================================
3
// File : KvsObject_menuBar.cpp
4
// Creation date : Tue Now 26 13:16:59 CEST 2002 by Szymon Stefanek
6
// This file is part of the KVIrc irc client distribution
7
// Copyright (C) 2002-2010 Szymon Stefanek (pragma at kvirc dot net)
9
// This program is FREE software. You can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your opinion) any later version.
14
// This program is distributed in the HOPE that it will be USEFUL,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
// See the GNU General Public License for more details.
19
// You should have received a copy of the GNU General Public License
20
// along with this program. If not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
//=============================================================================
26
#include "KvsObject_menuBar.h"
28
#include "kvi_debug.h"
29
#include "KviLocale.h"
38
A menu bar object implementation
45
!fn: <integer> $insertItem(<text:string>)
46
Returns an integer that identifies the inserted item.
49
KVSO_BEGIN_REGISTERCLASS(KvsObject_menuBar,"menubar","widget")
50
KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_menuBar,insertItem)
51
KVSO_END_REGISTERCLASS(KvsObject_menuBar)
53
KVSO_BEGIN_CONSTRUCTOR(KvsObject_menuBar,KvsObject_widget)
55
KVSO_END_CONSTRUCTOR(KvsObject_menuBar)
58
KVSO_BEGIN_DESTRUCTOR(KvsObject_menuBar)
60
KVSO_END_CONSTRUCTOR(KvsObject_menuBar)
62
bool KvsObject_menuBar::init(KviKvsRunTimeContext *,KviKvsVariantList *)
68
KVSO_CLASS_FUNCTION(menuBar,insertItem)
70
CHECK_INTERNAL_POINTER(widget())
72
KVSO_PARAMETERS_BEGIN(c)
73
KVSO_PARAMETER("item",KVS_PT_STRING,0,szItem)
74
KVSO_PARAMETERS_END(c)
75
((QMenuBar *)widget())->addAction(szItem);