Commit Graph

963 Commits

Author SHA1 Message Date
Matthew Flatt
bfc9c41358 racket/gui: double-check size on attmpt to set editor scroll
A scroll request could fail if a resize notification is still
in flight (i.e., queued but not yet executed), so double-check
the size on a scroll request.

Closes PR 13582
2013-03-31 06:39:49 -06:00
Matthew Flatt
b041a151e6 racket/gui: fix auto-scrollbars for editor GUI
It's possible to go from a state where one scroll bar is needed
(vertical or horizontal) to a state where each scrollbar is
needed iff the other scrollbar is needed. In that case, the
auto-scrollbar algorithm couldn't find either fixpoint and
would loop forever.
2013-03-25 05:15:24 -06:00
Matthew Flatt
e0486a7cf0 racket/gui: add warp-pointer' to window<%>'
Removed the method from `canvas<%>', where it was never implemented
with the `racket/gui' reimplementation.
2013-03-19 15:53:13 -07:00
Eli Barzilay
af6be85ff5 Fix lots of indentation mistakes.
(Found by my ayatollah script...)
2013-03-14 10:55:47 -04:00
Matthew Flatt
0c37849f81 racket/gui: fix contract of set-value' in gauge%' 2013-02-15 16:02:53 -07:00
Matthew Flatt
d5c1a75e38 racket/gui cocoa: fix over-eager refresh for 'gl canvas% 2013-02-14 19:47:40 -07:00
Matthew Flatt
d0cfc34a77 racket/gui/base: fix menu-bar%' get-frame' to return 'root
Return 'root istead of exposing the (hidden) root frame for
a menu bar that is shown when no frames are visible.
2013-02-05 11:44:38 +01:00
Matthew Flatt
e22977667d racket/gui gtk: fix canvas/panel border drawing
The code to draw a border has to determine the widget's position
within the drawing window. Gtk 3.0 has a function to provide that
transformation, but Gtk 2.0 doesn't seem to have one, and it seems
that the transformation implemented in `racket/gui' wasn't right.

Closes PR 13453
2013-01-25 14:21:57 -07:00
Robby Findler
5301646baf fix a bug in recently added display-changed method 2013-01-21 13:47:43 -06:00
Matthew Flatt
55f98a15d4 racket/gui gtk: make `on-demand' for menus work better
There appears to be no way to make `on-demand' work right for the
Unity window manager's global menu bar, since there's no notificiation
when the menu bar is clicked. We approximate the correct behavior
by calling `on-demand' when a containing frame loses the keyboard
focus, which might be because the menu bar was clicked; that may be
too late (because the menu has already been shown), but it should
work most of the time.

Closes PR 13347.

Relevant to PR 13395, but DrRacket will have to change to work
around the remaining limitations of `on-demand'.
2013-01-01 15:55:36 -07:00
Matthew Flatt
07d5a9e385 fix `expt' on small negative number and large positive odd
The pow() function apparently gets it wrong on some platforms.

Closes PR 13391
2013-01-01 12:33:59 -07:00
Robby Findler
1298c11d2f adjust find-string in text% so it doesn't allocate as many temporary strings
Also, Rackety
2012-12-24 23:35:12 -06:00
Robby Findler
19d6f7a15a Rackety 2012-12-21 19:22:59 -06:00
Robby Findler
3f9e60a908 add display-changed method 2012-12-21 19:22:59 -06:00
Robby Findler
8d4dac318c hold onto all frames weakly 2012-12-21 15:43:12 -06:00
Matthew Flatt
5b016b4c32 win32: support MinGW build
A MinGW build is the same shape as a MSVC build (but without
MzCOM), unlike a Cygwin build.
2012-12-09 11:26:02 -07:00
Robby Findler
ad2e8ac54e fix error check on the result of place-children
The main problem is that it asked exact? on an unknown
value and exact? works only on numbers.

But since I was here, also try to clarify the error message a bit.
2012-11-28 10:54:34 -06:00
Samuel Bronson
b366d04792 Typo fixes 2012-11-27 07:55:29 -07:00
Robby Findler
0264d3d5ad Adjust text%s so they don't call on-reflow as often
Specifically, when a style change happens that ends up
not changing the size of anything, then track that
lack of size change enough to be able to avoid
calling on-reflow.

This is important for the interaction between the
colorer and the search bubbles in DrRacket. That is,
when you make an edit that causes the colorer to have
lots of work, then each chunk of work it does before
yielding control to the event loop would also trigger
a call to on-reflow, which would cause the search bubbles
to recompute their sizes. Overall, the main bad thing
this does is cause lots of allocation and aside from
that it doesn't hurt interactivity. Still, there is a
lot of useless work here, and those extra GCs can be
pretty substantial when you're doing something crazy like
searching for " " in a big file.... (there are 95k spaces
in unit.rkt, in case you were curious)
2012-11-25 20:58:13 -06:00
Robby Findler
6fff8a3030 make right-clicking on non-text offer copy and cut in the
popup menu

Extends append-editor-operation-menu-items so that when you
pass an editor and a position, it checks to see if that spot
has a non-string% snip and, if so, copies that one position
(or cuts it, depending).

Then, use that extension in DrRacket

closes PR 12791
2012-11-22 17:33:34 -06:00
Matthew Flatt
31f7cfb486 racket/gui gtk: fix end-doc' for printer-dc%'
Contract demands a void result.
2012-11-20 07:15:28 -07:00
Matthew Flatt
d90fbaeff4 scheme/gui/base: fix module-attach problem in `make-gui-base-namespace'
The `scheme/base' module had become unreachable from the `mred' module.
While that normally would be a good thing, it lead to troublesome
multiple instantiations of `scheme/base' that caused problems for
attaching further modules to the namespace.
2012-11-19 07:56:48 -07:00
Robby Findler
3aac6ec715 add the name of the function to the message string in the gui-event logger 2012-11-16 07:26:38 -06:00
Matthew Flatt
7b04571fac racket/gui: add `get-current-mouse-state' 2012-11-07 14:37:39 -07:00
Eli Barzilay
672910f27b Lots of bad TAB eliminations.
I started from tabs that are not on the beginning of lines, and in
several places I did further cleanings.

If you're worried about knowing who wrote some code, for example, if you
get to this commit in "git blame", then note that you can use the "-w"
flag in many git commands to ignore whitespaces.  For example, to see
per-line authors, use "git blame -w <file>".  Another example: to see
the (*much* smaller) non-whitespace changes in this (or any other)
commit, use "git log -p -w -1 <sha1>".
2012-11-07 11:22:20 -05:00
Matthew Flatt
068240e9fe racket/gui: fix problems with control labels and client/global positions
Closes PR 13232
2012-11-04 08:47:50 -07:00
Matthew Flatt
0c82f54912 racket/gui: add delete' to choice%' and `list-control<%>'
Closes PR 13230
2012-11-04 08:25:43 -07:00
Matthew Flatt
ad703025c5 error message repair 2012-11-04 06:09:21 -07:00
Robby Findler
95841b9303 lift the restriction that the port passed to open-input-text-editor
cannot change its revision number during reading

This restriction was enforced only for editors that have non
string-snip% snips. The restriction was in place because the
implementation strategy was to chain thru the snips in the editor
using (send snip next) and that isn't safe if the revision number
changes.

The lifting of the restriction is implemented by tracking the position
in the editor where the last snip ended and, if the revision number
changes, starting over trying to get a snip from that position. This
has the effect that, if the revision number never changes, the code
should behave the same as it was doing before (so hopefully any new
bugs I've introduced in this commit will only show up if the old
implementation would have raised an error)

Also, exploit the lifting of this restriction in the colorer so it
doesn't to restart the port during to coloring that happens along with
the parsing
2012-11-02 10:24:34 -05:00
Robby Findler
6c760b086f reindent the implementation of open-input-text-editor
Apologies for the gratuitious reindent, but I was having
a lot of trouble reading this file; it appears to have
last been worked on in an Emacs that used tabs for indentation
and doesn't use the same tab width as drracket.
2012-11-02 10:24:34 -05:00
Robby Findler
33eba697a0 adjust the fields of the gui-event struct 2012-10-29 06:45:13 -05:00
Matthew Flatt
ba6e383963 racket/gui gtk: fix on-subwindow-... handling
Handling was broken by changes to fix enter and
leave events (in commit a5d7812732)

Merge to v5.3.1
2012-10-27 21:34:08 -06:00
Robby Findler
7e8ac872fe add logging to mred's event callback mechanism to record
how long event processing takes
2012-10-26 21:49:44 -05:00
Matthew Flatt
ebe0b64d47 racket/gui win32: fix drag-and-drop onto frame
Closes PR 13109

Merge to v5.3.1
2012-10-09 21:13:34 -06:00
Matthew Flatt
75008f14d7 win32: fix combo-field% click handling
Closes PR 13173

Merge to v5.3.1
2012-10-09 20:05:47 -06:00
Matthew Flatt
7ddd99cf52 racket/gui win32: fix duplicate pre- events for controls 2012-10-02 07:26:25 -06:00
Matthew Flatt
a5d7812732 racket/gui: skip some redundant 'enter & 'leave events 2012-10-02 07:26:25 -06:00
Matthew Flatt
efcad101d1 win32: fix coordinates of non-client mouse events
Closes PR 13141
2012-10-01 13:08:24 -06:00
Matthew Flatt
c16b696272 win32: fix for clipboard bitmap decoding
Closes PR 13119
2012-09-19 09:12:57 -06:00
Matthew Flatt
4f75350bf3 win32: fix(?) printing page-size calculation when in 100*mm
Windows provide page metrics in either 1000ths of inches or
100ths of millimeters. I think Racket's calculation was wrong
in the mm case.
2012-09-19 08:40:24 -06:00
Matthew Flatt
11045a0384 improve editor-canvas resizing
A recent bug fix involved moving part of an `editor-canvas%' resize
out of atomic mode by queueing a callback (because the resize involves
quesrying the editor for its size, etc.), but then the callback
happens after a canvas is shown, which can cause it to appear with
bogus initial scrollbars. Queue the callback instead as a "refresh"
level callback, which gets a chance to run before a frame is made
visible.
2012-09-13 14:17:14 -06:00
Matthew Flatt
69d2adce4d racket/gui: new-style error messages 2012-09-02 16:38:43 -06:00
Matthew Flatt
64eb4f9389 racket/gui: make `editor-canvas%' fail more gracefully on too-large content
Closes PR 13087
2012-09-02 10:08:23 -06:00
Matthew Flatt
19b2ee5e90 racket/gui: get get-scroll-pos', etc., arguments for canvas%' 2012-09-02 10:08:18 -06:00
Matthew Flatt
7291e1a24d racket/gui win32: atomicity repair 2012-08-29 17:45:59 -06:00
Matthew Flatt
dba3c14746 fix editor-canvas%' internal on-size' handling
The `on-size' method is called in atomic mode,
and we can't call into the editor's sizing functions
in atomic mode.

Watch out for refresh and/or window-sizing problems.
2012-08-28 17:21:45 -06:00
Matthew Flatt
088d1dadb4 add ffi/unsafe/nsalloc' and ffi/unsafe/nsstring' 2012-08-24 15:48:58 -06:00
Matthew Flatt
d9784aa7eb win32 racket/gui: fix decoding of system font name
Closes PR 12997
2012-08-23 08:16:23 -06:00
Matthew Flatt
30da0f4bf4 fix internal position adjustment for `pane%'
Closes PR 13038
2012-08-22 09:07:05 -06:00
Matthew Flatt
0648556bea racket/gui: internal cleanup
As suggested by Robby.
2012-08-13 17:11:20 -06:00