From kde-devel Tue Jun 14 15:08:05 2005 From: Kevin Krammer Date: Tue, 14 Jun 2005 15:08:05 +0000 To: kde-devel Subject: Re: Context menus (an idea for summer of code?) Message-Id: <200506141708.12059.kevin.krammer () gmx ! at> X-MARC-Message: https://marc.info/?l=kde-devel&m=111876174805243 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1375382951==" --===============1375382951== Content-Type: multipart/signed; boundary="nextPart1629559.JV1djY3XDo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1629559.JV1djY3XDo Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 13 June 2005 21:39, Thomas Friedrichsmeier wrote: > Next let's see, what you need to do (as a programmer) to provide a context > menu. In the easiest case you're implementing a single widget, and every > time the user right-clicks in that widgest it's roughly appropriate to > always dispaly the same popup-menu. So, what you do, is to create a > popup-menu, populate it with menu-items, and show it whenever the user > performs an RMB-click. Actually when the widget receives a ContextMenuEvent, i.e. the void=20 contextMenuEvent(QContextMenuEvent*) method gets invoked, or overloaded for= ms=20 which provide better context data like the one from QListView > So, we'd have a class KontextMenu, which is derived from KPopupMenu. There > will be an API for this class to tell it: "Ok, there is a context called > 'image'. This context is associated with the following options: A, B, C. > Next there is a context called 'link' with options C, D, E...". Then, when I think it would be better to associate it with a menu defined in the XMLGU= I=20 file. AFAIK it is already supported to create popupmenus this way, but only a few= =20 applications actually use it. Maybe this could be made easier with a special context menu class. > appropriate context menu", and moreover providing a GUI to configure > options. If we had a generic KontextMenu, however, all this would be a > feasible one-time effort. The programmer would merely call > KontextMenu::createConfigurationWidget () or whatever. Having a configuration dialog for XMLGUI defined menus would indeed be neat. Cheers, Kevin =2D-=20 Kevin Krammer Qt/KDE Developer, Debian User Moderator: www.mrunix.de (German), www.qtforum.org --nextPart1629559.JV1djY3XDo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBCrvLbnKMhG6pzZJIRAntEAJ9jWby3HOhg1fPBVB6DbfDWvl5koACdG0AG JSWyP7vj1v0v2gGiDdpgOq4= =t/Gh -----END PGP SIGNATURE----- --nextPart1629559.JV1djY3XDo-- --===============1375382951== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============1375382951==--