Permalink
Browse files

- Linux: fixed RPM package build

- Updated doxygen
- Mac: mforms: FileChooser: Fixed get_directory() to return the directory isntead of the whole path
- Mac: mforms: ScrollPanel: fixed scroll_to()
- mforms: Swig: fixed base::Rect used in return values to be unpacked into a tuple
- mforms: Popover: added a show_bound() method to show a popover attached to a specific view. If the mouse moves outside that view, it will emit signal_close() so the caller can close i
- Mac implementation added. Windows and Linux pending
- Added use of show_bound in performance dashboard
[TESTS]
- various attempts at leaving tooltip open in performance dashboard while moving the mouse and focus away
- interactive tests of fixed functionality in visual explain fix branch
  • Loading branch information...
1 parent e509d76 commit 417c908430cd49661a2e457b14f73bc906e58f5c @akojima akojima committed Jun 5, 2014
@@ -168,7 +168,7 @@ Windows, Linux and Mac OS X.
-DMYSQL_CONFIG_PATH=%{mysql_home}/bin/mysql_config \
-DMYSQLCPPCONN_LIBRARY="-L%{mysqlcppconn_dir}/lib -lmysqlcppconn" \
-DMYSQLCPPCONN_INCLUDE_DIR=%{mysqlcppconn_dir}/include \
- -DIODBC_CONFIG_PATH=${odbc_home}/bin/iodbc-config \
+ -DIODBC_CONFIG_PATH=%{odbc_home}/bin/iodbc-config \
%if 0%{?commercial}
-DVSQLITE_INCLUDE_DIR=%{vsqlite_dir}/include \
-DVSQLITE_LIBRARIES="-L%{vsqlite_dir}/lib -lvsqlitepp" \
View
Oops, something went wrong.
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -205,7 +205,7 @@ static void filechooser_set_directory(mforms::FileChooser *self, const std::stri
MFFileChooserImpl *chooser= self->get_data();
if (chooser)
{
- return [chooser->mPanel.URL.path UTF8String];
+ return [[chooser->mPanel.URL URLByDeletingLastPathComponent].path UTF8String];
}
return "";
}
@@ -23,12 +23,15 @@
@interface MFPopover : NSWindow
{
+ mforms::Popover *mOwner;
NSView* mChildContentView;
NSPoint mHotSpot; // Position in screen coordinates.
mforms::StartPosition mRelativePosition;
NSSize mBaseSize;
base::Padding mPadding;
mforms::PopoverStyle mStyle;
+ NSView *mTrackedView;
+ NSTrackingArea *mOwnerTracking;
int mArrowSize;
int mArrowBase;
@@ -415,9 +415,26 @@ - (void)show: (NSPoint)location relativePosition: (mforms::StartPosition)positio
}
//--------------------------------------------------------------------------------------------------
+// Tracking area related
+
+- (void)mouseExited:(NSEvent *)theEvent
+{
+ if ([theEvent userData])
+ {
+ (*mOwner->signal_close())();
+ }
+ else
+ [super mouseExited: theEvent];
+}
+
+//--------------------------------------------------------------------------------------------------
- (void)close
{
+ [mTrackedView removeTrackingArea: mOwnerTracking];
+ [mOwnerTracking release];
+ mOwnerTracking = nil;
+ mTrackedView = nil;
[[NSAnimationContext currentContext] setDuration: 0.25];
[[self animator] setAlphaValue: 0];
[self performSelector: @selector(orderOut:) withObject: nil afterDelay: 0.5
@@ -436,6 +453,7 @@ static bool popover_create(Popover* popover, mforms::PopoverStyle style)
defer: NO
style: style]
autorelease];
+ popoverWindow->mOwner = popover;
[popoverWindow setHasShadow: YES];
[popoverWindow setLevel: NSPopUpMenuWindowLevel];
popover->set_data(popoverWindow);
@@ -466,6 +484,21 @@ static void popover_show(Popover* popover, int x, int y, StartPosition relativeP
//--------------------------------------------------------------------------------------------------
+static void popover_show_bound(Popover* popover, View *owner, int x, int y, StartPosition relativePosition)
+{
+ MFPopover *impl = popover->get_data();
+ [impl show: NSMakePoint(x, y) relativePosition: relativePosition];
+ NSTrackingArea *tarea = [[NSTrackingArea alloc] initWithRect: [owner->get_data() bounds]
+ options: NSTrackingMouseEnteredAndExited|NSTrackingAssumeInside|NSTrackingActiveAlways
+ owner: popover->get_data()
+ userInfo: [NSDictionary dictionary]];
+ [owner->get_data() addTrackingArea: tarea];
+ impl->mTrackedView = owner->get_data();
+ impl->mOwnerTracking = tarea;
+}
+
+//--------------------------------------------------------------------------------------------------
+
static void popover_close(Popover* popover)
{
[popover->get_data() close];
@@ -489,6 +522,7 @@ void cf_popover_init()
f->_popover_impl.set_content= &popover_set_content;
f->_popover_impl.set_size= &popover_set_size;
f->_popover_impl.show= &popover_show;
+ f->_popover_impl.show_bound= &popover_show_bound;
f->_popover_impl.close= &popover_close;
}
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -209,7 +209,7 @@ static void scrollpanel_scroll_to(mforms::ScrollPanel *self, int x, int y)
{
MFScrollPanelImpl *panel= self->get_data();
if (panel)
- [panel scrollPoint: NSMakePoint(x, y)];
+ [[panel documentView] scrollPoint: NSMakePoint(x, y)];
}
@@ -55,6 +55,7 @@ namespace mforms {
void (*set_content)(Popover *self, View *content);
void (*set_size)(Popover *self, int, int);
void (*show)(Popover *self, int, int, StartPosition); // Position of the popover's tip in screen coordinates.
+ void (*show_bound)(Popover *self, View*, int, int, StartPosition); // Position of the popover's tip in screen coordinates.
void (*close)(Popover* self);
};
#endif
@@ -84,6 +85,13 @@ namespace mforms {
void show(int x, int y, StartPosition position);
void close();
+ /** Same as show, but the popover will automatically close when the mouse moves outside of the area occcupied by the owner view */
+ void show_bound(View *owner, int x, int y, StartPosition position); //TODO: Windows, Linux
+
+ boost::signals2::signal<void ()> *signal_close() { return &_bound_close; }
+
+ private:
+ boost::signals2::signal<void ()> _bound_close;
};
};
@@ -45,6 +45,11 @@ void Popover::show(int x, int y, StartPosition position)
_popover_impl->show(this, x, y, position);
}
+void Popover::show_bound(View *owner, int x, int y, StartPosition position)
+{
+ _popover_impl->show_bound(this, owner, x, y, position);
+}
+
void Popover::set_size(int width, int height)
{
_popover_impl->set_size(this, width, height);
@@ -538,6 +538,10 @@ inline boost::function<void (mforms::TextEntryAction)> pycall_void_entryaction_f
%typemap (in) int64_t, boost::int64_t = long long;
%typemap (out) int64_t, boost::int64_t = long long;
+%typemap (out) base::Rect {
+ $result = Py_BuildValue("(ffff)", $1.left(), $1.top(), $1.width(), $1.height());
+}
+
%typemap(in) const std::string& {
if (PyUnicode_Check($input))
{
@@ -1133,4 +1137,8 @@ BOOST_ADD_SIGNAL_VOID_STRING_CALLBACK(link_click_callback, self->signal_link_cli
SWIG_ADD_SIGNAL_VOID_TOOLBARITEM_CALLBACK(activated_callback, self->signal_activated());
}
+%extend mforms::Popover {
+SWIG_ADD_SIGNAL_VOID_CALLBACK(close_callback, self->signal_close());
+}
+
%include mforms_extras.i
@@ -193,7 +193,8 @@ def handle_hover_in(self, fig, x, y):
self.tooltip.set_size(max(box.get_preferred_width(), 100), max(box.get_preferred_height(), 50))
self.tooltip.set_content(box)
- self.tooltip.show(xx, yy, mforms.Right)
+ self.tooltip.add_close_callback(self.close_tooltip)
+ self.tooltip.show_bound(self, xx, yy, mforms.Right)

0 comments on commit 417c908

Please sign in to comment.