|
|
Re: Reordering Table Columns in Carbon [message #444567 is a reply to message #444144] |
Fri, 15 October 2004 00:25 |
Mike McMahon Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Nice work Chris! I am now working on this same feature for Win32 and for
Linux. I plan to submit my patches back to eclipse.org, perhaps with
your work on Mac these features are getting closer to full
cross-platform and therefore candidate for official release
Chris Nagy wrote:
> Hi,
>
> I've managed to figure out how turn on auto-sorting and dragging table
> columns in OS X. However, the table columns do not get moved and I think
> this is because I haven't attached a Callback to the table.
>
> From the Carbon documentation, I found the
> 'DataBrowserAcceptDragProcPtr' callback which might be used to accept
> reordering of columns. I tried looking at how to create my own Callback
> for a table but ran into some difficulties.
>
> For one, the 'DataBrowserAcceptDragProcPtr' requires a Boolean to be
> returned, but all the Callback instances in SWT return an int. Will SWT
> convert the int into a boolean?
>
> Also, should I create one global Callback (like in DropTarget) and
> lookup the table that is the source of the event?
>
> Here is the small piece of code that I added to Table to get the auto-
> sorting and dragable table columns :
>
> public class Table extends Composite {
>
> ...
> public static final int kDataBrowserListViewMovableColumn = 1 << 17;
>
> ...
> void createItem (TableColumn column, int index) {
>
> ...
> desc.propertyDesc_propertyFlags =
> OS.kDataBrowserListViewSortableColumn |
> kDataBrowserListViewMovableColumn | OS.kDataBrowserDefaultPropertyFlags;
>
> ...
> }
> ...
> }
>
> Thanks in advance,
>
>
> Chris Nagy
|
|
|
Re: Reordering Table Columns in Carbon [message #444596 is a reply to message #444567] |
Fri, 15 October 2004 18:37 |
Chris Nagy Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hi Mike,
I've submitted the changes I had to make for Mac OSX to bug 22035. I
didn't have to write a Callback because I just had to enable a setting
on a Shell (ie. Window).
Also, I had submitted some code for win32 and was looking at GTK. There
seems to be a method 'gtk_tree_view_column_set_reorderable' that enables
a column to be reordered. I don't have Linux desktop box to test this
out but this might help you.
There are only two other platforms left : Motif and Qnx (Photon)
If you already finished implementing this feature for Win32 and Linux
then feel free to send me an email or reply how you did it.
Thanks,
Chris Nagy
Mike McMahon <michael.mcmahon_at_activewire_dot_net@no.spam> wrote in
news:ckn52m$1to$1@eclipse.org:
> Nice work Chris! I am now working on this same feature for Win32 and
> for Linux. I plan to submit my patches back to eclipse.org, perhaps
> with your work on Mac these features are getting closer to full
> cross-platform and therefore candidate for official release
>
> Chris Nagy wrote:
>> Hi,
>>
>> I've managed to figure out how turn on auto-sorting and dragging
>> table columns in OS X. However, the table columns do not get moved
>> and I think this is because I haven't attached a Callback to the
>> table.
>>
>> From the Carbon documentation, I found the
>> 'DataBrowserAcceptDragProcPtr' callback which might be used to accept
>> reordering of columns. I tried looking at how to create my own
>> Callback for a table but ran into some difficulties.
>>
>> For one, the 'DataBrowserAcceptDragProcPtr' requires a Boolean to be
>> returned, but all the Callback instances in SWT return an int. Will
>> SWT convert the int into a boolean?
>>
>> Also, should I create one global Callback (like in DropTarget) and
>> lookup the table that is the source of the event?
>>
>> Here is the small piece of code that I added to Table to get the
>> auto- sorting and dragable table columns :
>>
>> public class Table extends Composite {
>>
>> ...
>> public static final int kDataBrowserListViewMovableColumn = 1 <<
>> 17;
>>
>> ...
>> void createItem (TableColumn column, int index) {
>>
>> ...
>> desc.propertyDesc_propertyFlags =
>> OS.kDataBrowserListViewSortableColumn |
>> kDataBrowserListViewMovableColumn |
>> OS.kDataBrowserDefaultPropertyFlags;
>>
>> ...
>> }
>> ...
>> }
>>
>> Thanks in advance,
>>
>>
>> Chris Nagy
>
|
|
|
Powered by
FUDForum. Page generated in 0.03043 seconds