Skip to content

XAware Community

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
XAware 5.6
Need Help
Webinars and Events
Advanced Tutorials
Webinars and Events

You are here: Home arrow Forums
XAware Community Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Workig on mac solution (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Workig on mac solution
#2887
tferguson (User)
XAware expert
Posts: 494
User Offline Click here to see the profile of this user
Re:Workig on mac solution 12 Years, 1 Month ago Karma: 6  
Hi Vasu,

I thought that too, for instance, since there is only 1 mouse button on the mac I changed the event to be button 1, and the added the stateMask = SWT.CONTROL as shown below:

Code:

if (Platform.getOS().equals(Platform.OS_MACOSX)) { event.button = 1; event.stateMask = SWT.CONTROL; } else { event.button = ControlFactory.MOUSE_RIGHT_BUTTON_ID; }
However, when I did the post, it still was not triggering - perhaps there is something wrong with the Display.post(event) on OS X, I am not sure. So what I ended up with is:
Code:

protected void fireRightClick(final Tree tree) { processMousePressedEvent = false; Event event = new Event(); event.type = SWT.MouseDown; // For a mac, sending button = 3 will cause an unrecoverable lock up // of the system if a 3 button mouse is not connected. The default mac // mouse is a single button and you use CONTROL with the mouse button if (Platform.getOS().equals(Platform.OS_MACOSX)) { event.button = ControlFactory.MOUSE_LEFT_BUTTON_ID; event.stateMask = SWT.CONTROL; } else { event.button = ControlFactory.MOUSE_RIGHT_BUTTON_ID; } event.item = tree; event.doit = true; tree.notifyListeners(event.type, event); event = new Event(); event.type = SWT.MouseUp; if (Platform.getOS().equals(Platform.OS_MACOSX)) { event.button = ControlFactory.MOUSE_LEFT_BUTTON_ID; event.stateMask = SWT.CONTROL; } else { event.button = ControlFactory.MOUSE_RIGHT_BUTTON_ID; } event.doit = true; event.item = tree; dndEditorMenu.setVisible(true); tree.notifyListeners(event.type, event); }
On the mac I also changed all of the code where the MouseListener was trying to determine if the event was from a right click to also check the stateMask and if it was SWT.CONTROL and button 1 then it was the same as a right click. I also changed when checking to see if it was a left click to make sure that the eventMask was either SWT.NONE or it could also be SWT.BUTTON1 in the case of a drag and drop. One other place of contention was there were a few places in the code where it was:
Code:

if (Platform.getOS().equals(Platform.OS_WIN32)) { ...do something } else if (Platform.getOS().equals(Platform.LINUX)) { ... do something else }
Since everything else I can think of is a unix/linux variant I changed to:
Code:

if (Platform.getOS().equals(Platform.OS_WIN32)) { ...do something } else { ... do something else }
With these changes I am at least able to install and I have basic functionality. However there are issues in displays not showing correctly for drop downs, in SQL when a table has been added to the canvas you can't resize it, etc. Just go through the SQL wizard on OS X to see some of what I am talking about. I want to next see if those same display issues are there on Linux, but I haven't gotten to that yet. Let me know if you see any issues with what I have proposed.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
      Topics Author Date
    thread link
Workig on mac solution
tferguson 2008/10/09 15:25
    thread link
thread linkthread link Re:Workig on mac solution
Vasu Thadaka 2008/10/10 04:59
    thread link
thread linkthread linkthread link Re:Workig on mac solution
tferguson 2008/10/10 12:25
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Community Login

Get the Flash Player to see this player.
Flash Image Rotator Module by Joomlashack.
Commercial
Free Training
QuickStart Packages
Image 4 Title
Image 5 Title

Visit XAware.com