realbasic-nug
[Top] [All Lists]

Re: Contextual click on listbox header

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Contextual click on listbox header
From: Frank Bitterlich <bitterlich2@gsco.de>
Date: Fri, 27 Feb 2009 17:59:47 +0100
Authentication-results: mx.google.com; spf=temperror (google.com: error in processing during lookup of realbasic-nug-bounces@lists.realsoftware.com: DNS timeout) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <F2EF08E6-1F4C-4B93-BE3C-BFDF618F08D2@online.de>
References: <E1D852E9-A6DB-421A-9438-85A69E61256C@gsco.de> <F2EF08E6-1F4C-4B93-BE3C-BFDF618F08D2@online.de>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
That's another (even simpler) way of working around the problem - I'll use that.

But still a pity that one can't use the built-in CM functions... it'd be much more elegant that way.

Thanks,
   Frank+++

Am 27.02.2009 um 10:05 schrieb Christian Dorn:

I want users to be able to contextual-click (right-click, control- click) on the header of a listbox, so I can display a menu where the user can choose which column to show/hide. Just like many Apple apps do (iTunes, Mail, etc).

But I can't get this to work. A right-click on a listbox header acts just like a left-click; even calling IsContextualClick() in the HeaderPressed event returns "false".

You have to catch the right-click in the ListBox's MouseDown event!
To find out, if the user clicked on the header, check the event's 'y' parameter.

if y < 20 and IsContextualClick() then
  ...
  // return 'true' to prevent the HeaderPressed event form firing
  return true
end if

I don't know, if there is a way to get the correct height of the header, but 20 seems a good value to me. At least on Mac OS X.



--

Günter Schmidt GmbH
Frank Bitterlich             eMail: bitterlich@gsco.de
Ben-Gurion-Ring 21           WWW:   http://www.gsco.de/
D-60437 Frankfurt            Tel.:  069 / 156809-29
GERMANY                      Fax:   069 / 156809-28
Geschäftsführer: Jürgen Hartwich
AG Frankfurt am Main, HRB 76504 - USt.-ID: DE235219624






_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>