Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Reordering Table Columns in Carbon
Reordering Table Columns in Carbon [message #444144] Thu, 07 October 2004 16:05 Go to next message
Chris Nagy is currently offline Chris NagyFriend
Messages: 10
Registered: July 2009
Junior Member
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 #444206 is a reply to message #444144] Fri, 08 October 2004 14:51 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Yes to both questions. You could use the same technique that Display uses
to map operating system objects to Java object.

"Chris Nagy" <cnagy@octanewave.com> wrote in message
news:Xns957B7BE767550cnagyoctanewavecom@204.138.98.10...
> 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 #444567 is a reply to message #444144] Fri, 15 October 2004 00:25 Go to previous messageGo to next message
Mike McMahon is currently offline Mike McMahonFriend
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 Go to previous message
Chris Nagy is currently offline Chris NagyFriend
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
>
Previous Topic:SWT Source code examples
Next Topic:ActiveX and return class
Goto Forum:
  


Current Time: Sun Nov 29 12:10:28 GMT 2020

Powered by FUDForum. Page generated in 0.02065 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top