• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Widgets Library
 

KDevelop Widgets Library

  • lib
  • widgets
tdelistviewaction.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 #include "tdelistviewaction.h"
20 #include "kcomboview.h"
21 #include "resizablecombo.h"
22 
23 #include <tqtooltip.h>
24 #include <tqwhatsthis.h>
25 
26 #include <tdeconfig.h>
27 #include <tdeglobal.h>
28 
29 TDEListViewAction::~TDEListViewAction()
30 {
31  TDEConfig *config = TDEGlobal::config();
32  if (config && m_view->name())
33  {
34  config->setGroup("TDEListViewAction");
35  config->writeEntry(m_view->name(), m_view->width());
36  }
37  delete m_view;
38 }
39 
40 TDEListViewAction::TDEListViewAction(KComboView *view, const TQString & text, const TDEShortcut & cut,
41  const TQObject * receiver, const char * slot, TDEActionCollection * parent, const char * name ):
42  KWidgetAction(view, text, cut, receiver, slot, parent, name), m_view(view)
43 {
44  m_view->setDuplicatesEnabled(false);
45  m_view->setInsertionPolicy(KComboView::NoInsertion);
46 
47  loadComboWidth();
48 }
49 
50 TDEListViewAction::TDEListViewAction( KComboView * view, const TQString & text, const TDEShortcut & cut,
51  const TQObject * receiver, const char * slot, TDEActionCollection * parent, const char * name, const bool /*dummy*/ ):
52  KWidgetAction(new ResizableCombo(view), text, cut, receiver, slot, parent, name), m_view(view)
53 {
54  m_view->setDuplicatesEnabled(false);
55  m_view->setInsertionPolicy(KComboView::NoInsertion);
56 
57  loadComboWidth();
58 }
59 
60 KComboView * TDEListViewAction::view( ) const
61 {
62  return m_view;
63 }
64 
65 void TDEListViewAction::setToolTip( const TQString & str )
66 {
67  TQToolTip::remove(m_view);
68  TQToolTip::add(m_view, str);
69 }
70 
71 void TDEListViewAction::setWhatsThis( const TQString & str )
72 {
73  TQWhatsThis::remove(m_view);
74  TQWhatsThis::add(m_view, str);
75 }
76 
77 void TDEListViewAction::loadComboWidth( )
78 {
79  TDEConfig *config = TDEGlobal::config();
80  if (config && m_view->name())
81  {
82  config->setGroup("TDEListViewAction");
83  m_view->setMinimumWidth(config->readNumEntry(m_view->name(), m_view->defaultWidth()));
84  }
85 }
86 
ResizableCombo
Resizable combo box.
Definition: resizablecombo.h:38
tdelistviewaction.h
Widget action with KComboView.
resizablecombo.h
Resizable combo box.
kcomboview.h
KComboView class.

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDevelop Widgets Library

Skip menu "KDevelop Widgets Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Widgets Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.