Commit Graph

924 Commits

Author SHA1 Message Date
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
Matthew Flatt
1800680c6b racket/gui: fix access of scrollbar values for canvas without a scrollbar 2012-08-12 20:17:29 -06:00
Matthew Flatt
d5024f0f20 win64 racket/gui: another work around for Cairo clipping issues
Cairo doesn't seem to deal correctly with an HDC produced
by BeginPaint() that has a clipping region. The problem affects
only Win64. Work around the problem by drawing to a separate
HDC and copying to/from the screen. (To see the problem before
this patch, draw the DrRacket window to the edge of the screen
and back, and observe tha the toolbar doesn't update correctly.)

This change could affect performance, but it should mostly
be limited to refresh when a window moves.
2012-08-08 09:56:44 -06:00
Matthew Flatt
b111241afe racket/gui/init: fix load handler 2012-07-18 03:52:20 -06:00
Matthew Flatt
cc2c701a7d racket/gui/init: make load handler chain to original
For a non-WXME file, fall back to the original load handler,
instead of re-implementing it. This makes module caching work
the right way. Falling back to the original means closing
the port and then re-opening the file to load, but that seems
ok.
2012-07-17 06:19:15 -06:00
Matthew Flatt
5f1c8d3ec9 Revert "racket/gui/init: module caching in the load handler"
This reverts commit 5c02b1c95a.

The caching table doesn't hold entries weakly, which means that
it can be a space leak.
2012-07-17 06:11:35 -06:00
Matthew Flatt
5c02b1c95a racket/gui/init: module caching in the load handler 2012-07-16 19:22:30 -06:00
Jay McCarthy
1685952b9b Making key-code-symbol consistent with docs 2012-07-10 19:21:24 -04:00
Matthew Flatt
c7d181c2a9 racket/gui, win32: fix problem with mimize for fixed-size window 2012-06-23 04:15:28 -06:00