Compare commits

..

117 Commits

Author SHA1 Message Date
Bryan Petty
f05fb3ea61 This commit was manufactured by cvs2svn to create tag
'BEFORE_LINEWRAP_OPTIMIZE'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/BEFORE_LINEWRAP_OPTIMIZE@8857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-28 17:19:11 +00:00
Vadim Zeitlin
8c27f612e5 now cache GetCharWidth() too (and not only height)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-28 17:19:11 +00:00
Vadim Zeitlin
be18e65726 split wxTextCtrl data members in wxSingle/MultiData
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-27 20:26:24 +00:00
Vadim Zeitlin
10644bd0bd more work on wxTextCtrl: mostly works but very slow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-27 01:28:52 +00:00
Vadim Zeitlin
528a112b2c 1. fix for generation of mouse enter/leave events in wxMSW
2. render disabled check/radio box [more] correctly
3. several bug fixes with m_posLast caching
4. implemented wxTextCtrl word (as opposed to line) wrap
5. problem with selection refresh in line wrap style fixed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8827 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-26 04:36:33 +00:00
Vadim Zeitlin
20b45caa12 1. don't call GetPartOfWrappendLine() unnecessarily
2. optimized it (replaced by a call to HitTestLine) for the other cases


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-26 02:05:33 +00:00
Vadim Zeitlin
eafd9d4f24 added wxRenderer::DrawTextBorder() to deal with GTK+ text borders
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-24 18:59:17 +00:00
Vadim Zeitlin
6378b5268d fixed vert offset for single line text ctrls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-24 17:31:02 +00:00
Vadim Zeitlin
17516c205e 1. more work on line wrap - mostly works now
2. small fixes to wxStaticText (best size calc) and to check box


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-20 01:16:27 +00:00
Vadim Zeitlin
55b9ea2484 more work on wxTextCtrl with line wrapping: drawing/scrolling seems to
work, refresh still doesn't


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-18 19:49:21 +00:00
Vadim Zeitlin
d96fbfa52a more tests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-11 16:06:38 +00:00
Vadim Zeitlin
45911360b2 text is shown correctly in controls without wxHSCROLL (line wrap) style
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-11 04:31:42 +00:00
Vadim Zeitlin
8637e11695 added a few comments, nothing more
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-10 22:03:37 +00:00
Vadim Zeitlin
a00fd3e544 always show vert SB for multiline text ctrls without wxTE_RICH style
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-10 21:14:20 +00:00
Vadim Zeitlin
c0bd235861 more tests in texttest
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-08 20:32:36 +00:00
Vadim Zeitlin
a79c455963 1. wxCommand compilation fixes for Unix
2. added wxTextCtrl sample textctrl
3. fixed handling of wxTE_READONLY and wxTE_PASSWORD flags in wxTextCtrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-08 19:08:46 +00:00
Vadim Zeitlin
8190b05419 horz scrolling in etxt ctrl works better
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-07 16:55:41 +00:00
Vadim Zeitlin
472b41175a undo/redo seem to work in wxTextCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-06 00:54:23 +00:00
Vadim Zeitlin
7ad39665fa 1. wxTextCtrl::Replace() does work now - added many tests for it in univ sample
2. extracted wxCommand and wxCommandProcessor to separate files
3. fixed bug in wxStringTokenizer with strings consisting of sole delimiter
4. implemented (but untested) undo/redo for text ctrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-11-06 00:30:27 +00:00
Vadim Zeitlin
409299535d fixes for ScrollWindow() in caret presence (hide and reshow it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-31 17:36:41 +00:00
Vadim Zeitlin
99eb9f350e vert textctrl scrolling starts to work after tons of fixes to wxTextCtrl and
wxScrolledWindow (to better respect target window rect)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-31 01:56:42 +00:00
Vadim Zeitlin
f6c8b8f53d 1. fix for custom event handler in wxScrollWindow which was eating events
2. fix for (initial) selection anchor position in wxTextCtrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-30 21:15:15 +00:00
Vadim Zeitlin
9686c81605 compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-23 10:52:19 +00:00
Vadim Zeitlin
36830fc59e disabled text control doesn't show the caret
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-23 10:26:20 +00:00
Vadim Zeitlin
d131b63b6d 1. big wxScrollBar optimization: Refresh() doesn't refresh them any more
2. many fixes to refresh scrollbars when needed (as this is not done all
   the time now)
3. wxStdButtonInputHandler bug with uninit m_hasMouse fixing bug with
   moving mouse with pressed left button into button
4. wxRadioBox::SetSelection() and wxRadioButton::SetValue() clear the
   values of the other buttons in the same radio group
5. wxTextCtrl::RefreshPixelRange() calculates the end of line correctly
6. tons of wxListBox fixes
7. removed confusing "Create" button from the lbox sample, listbox is now
   recreated on the fly


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8615 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-23 01:45:21 +00:00
Vadim Zeitlin
1f720ce54b 1. wxScrollHelper can be used to scroll only parts of window
2. wxTextCtrl and wxButton size calc adjusted again


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-20 20:19:03 +00:00
Vadim Zeitlin
f104f965eb bug with lbox recreation fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-20 09:16:00 +00:00
Vadim Zeitlin
d55d0aa0f5 1. many (minor) listbox fixes
2. scrollbar thumb now has min size


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-20 00:48:55 +00:00
Vadim Zeitlin
bef37c03db more tests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-20 00:36:12 +00:00
Vadim Zeitlin
e2f369c206 1. wxListBox horz scrollbar fixes: now disappears when items are deleted
2. wxListBox quick searching on key press implemented


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-19 01:36:49 +00:00
Vadim Zeitlin
3b56ef075a wxTextCtrl works as itshould in disabled and/or not editable states
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-18 17:46:08 +00:00
Vadim Zeitlin
85df8658e0 fixed UpdateLastVisible() - but why was it broken???
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-18 16:22:59 +00:00
Vadim Zeitlin
8ea58028dc Replace() optimization for single line controls restored
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-18 16:11:09 +00:00
Vadim Zeitlin
facdb39467 1. more work on multiline text ctrl (scrolling...)
2. minor bugs in listbox/scrollbar fixed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-15 21:15:27 +00:00
Vadim Zeitlin
7e29723b0f movement by word works for multiline too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-15 19:50:55 +00:00
Vadim Zeitlin
c80b9af4d7 fixed bug when the caret wasn't shown if it was hidden when the window got focus the last time
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-15 19:47:44 +00:00
Vadim Zeitlin
6dbe10e7a6 wxTextCtrl::Replace() seems to work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-15 16:52:52 +00:00
Vadim Zeitlin
649850e16c basic drawing and cursor movement seem to work in multiline textctrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-14 23:34:47 +00:00
Vadim Zeitlin
b16e3fb5e8 many more methods implemented (though untested) for multline text ctrls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-12 19:39:12 +00:00
Vadim Zeitlin
b7cdbb0e4c 1. added wxStringTokenize
2. some multiline wxTextCtrl code


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-12 09:09:49 +00:00
Vadim Zeitlin
5abcba0bef drastically reduced scrollbar flicker when thumb is being dragged
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-09 23:25:27 +00:00
Vadim Zeitlin
a978bcef22 1. wxListBox::Delete() refresh bug fixed
2. wxScrollBar::HitTest() fixed (=> fixing refresh problem) for scrollbars
   without range


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-09 17:07:23 +00:00
Vadim Zeitlin
ca818da556 fixed horz scrollbar (dis)appearance
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-09 10:25:42 +00:00
Vadim Zeitlin
a3a13581dd 1. wxRadioBox event generation fixed
2. significantly expanded and enchanced listbox sample
3. wxTextCtrl::IsModified() implemented
4. wxRadioBox button layout fixed once again
5. wxTextCtrl::SetValue() refresh bug fixed
6. wxListCtrl doesn't keep invalid selection after Delete()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8493 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-08 23:12:36 +00:00
Vadim Zeitlin
943240b264 1. listbox sample fixed, now seems to work more or less (except for wxSizer problem)
2. wxRadioBox lays out items correctly
3. wxListBox::DoInsertItems() refreshes correctly
4. list box scrollbars are now refreshed correctly too


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-06 16:24:25 +00:00
Vadim Zeitlin
ea8259f286 1. fixed client size calculations for GTK
2. fixed wxGTK region code
3. fixed bug with out of bounds coords in wxTextCtrl::HitTest()
4. tried to (but failed) fix the initial caret appearance


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-05 19:10:37 +00:00
Vadim Zeitlin
b28342f733 1. (hopefully) fixed horz scrolling
2. only refresh part of line in Replace()
3. changed wxWindow::Refresh() to take client coordinates
4. only refresh the text which must be refreshed when selection changes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-10-01 22:47:30 +00:00
Vadim Zeitlin
62b93fefcf added debugging code to HitTest(), added m_posLastVisible and m_colLastVisible
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-30 21:25:29 +00:00
Vadim Zeitlin
f03ccf7b5b wxTextCtrl:
1. now only scroll the visible text, not the entire text rect
2. don't draw the columns before the leftmost (visible) one


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-30 00:43:45 +00:00
Vadim Zeitlin
8dd0bb9ab7 more fixes for horz scrolling, still unsuccessfully
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-28 16:25:45 +00:00
Vadim Zeitlin
bf4014c8de fix for wxRegion::Intersect
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-28 15:45:41 +00:00
Vadim Zeitlin
3ab62a0f7f 1. iterate over update region in wxTextCtrl
2. fixed DC clipping under wxMSW
3. fixes to enable clipboard under wxMSW


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-28 00:19:14 +00:00
Vadim Zeitlin
f0b67b1c57 no changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8424 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-26 18:09:55 +00:00
Vadim Zeitlin
db086a01fa fixed bug in ScrollWindow refresh logic
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-26 16:47:56 +00:00
Vadim Zeitlin
dd27aca4ee more work on horz textctrl scrolling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-25 00:20:56 +00:00
Vadim Zeitlin
b5366def43 1. modified wxMSW::wxCaret to use client coords
2. fixed uninit m_curXXX vars leading to a crash in wxMSW
3. fixed wxWindow::DoDrawBackground() for empty update region


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-23 23:28:48 +00:00
Vadim Zeitlin
025f9ba319 wxTextCtrl work:
1. horz scrolling (not perfect yet)
2. more actions (clipboard, double click)
3. wxCaret fixes
4. clipboard support
5. wxTE_PASSWORD support

wxScrolledWindow/wxlistBox:

better hit test calculation: take into account GetClientAreaOrigin()

fix for wxGTK bug in wxDC::Blit() in wxWindow::ScrollWindow

draw transparent radio bitmaps under GTK

wxWindow::ScrollWindow() can now scroll a part of window only


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-22 22:49:15 +00:00
Vadim Zeitlin
634b9eb4e4 1. better kbd interface to wxTextCtrl (selection...)
2. mouse input handling


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-18 19:07:24 +00:00
Vadim Zeitlin
c7a0b9e59e 1. wxNcPaintEvent for wxMSW
2. wxTextCtrl (single line) cursor movement/basic editing


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-17 04:03:07 +00:00
Vadim Zeitlin
8c1e69867c added lbox test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-16 18:51:01 +00:00
Vadim Zeitlin
e65ebedd36 1. OnNcPaint() fixed, seems to work
2. start of wxTextCtrl


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-15 18:22:18 +00:00
Vadim Zeitlin
ebd161b6c8 1. added wxNcPaintEvent and generate it under GTK/use under wxUniv
2. minor fixes to wxCheck/Radio/wxCheckList/Box appearance - now seems fine


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-15 14:35:31 +00:00
Vadim Zeitlin
07e9834fca wxCheckListBox works
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-14 20:10:34 +00:00
Vadim Zeitlin
4c81b707a5 restored DC clipping in wxScrolledWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8352 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-13 15:09:30 +00:00
Vadim Zeitlin
0ddd59282b 1. now clip wxPaintDC in its ctor
2. added wxCheckListBox


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-12 17:30:09 +00:00
Vadim Zeitlin
6e6616f755 1. undid wxGTK timer hack, corrected bug in my code
2. clip wxPaintDC to the client area


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-12 16:20:34 +00:00
Vadim Zeitlin
e45a8e8b4e hack to fix wxTimer problem
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-12 13:18:46 +00:00
Vadim Zeitlin
35fd96a83a wxRadioBox starts to work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8332 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-11 20:21:57 +00:00
Vadim Zeitlin
6e78473c26 now using xpm
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-10 22:25:20 +00:00
Vadim Zeitlin
1ca6cc68e0 wxRadioButton works under MSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-10 22:23:05 +00:00
Vadim Zeitlin
5b1d0de44a wxRadioButton more or less works under GTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-10 16:39:54 +00:00
Vadim Zeitlin
bc2dad04e7 added radio button (which doesn't work yet)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8314 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-09 22:39:59 +00:00
Vadim Zeitlin
a02336b2bb 1. wxRenderer now has DrawCheckButton
2. wxCheckBox seems to work under MSW


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-09 19:41:33 +00:00
Vadim Zeitlin
0399bce91f 1. fixed (yet again) highlighting of buttons and checkboxes
2. wrote input handlers for the checkbox
3. fixed bug in wXMouseEvent generation in gtk/window.cpp
4. added focus rect drawing and check/radio geometry queries to wxRenderer


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-08 19:03:00 +00:00
Vadim Zeitlin
f40a103306 fixed internal border drawing for listbox in GTK theme
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-08 15:12:49 +00:00
Vadim Zeitlin
a10069108f 1. replaced wxRenderer::AdjustScrollbar with AreScrollbarsInsideBorder(),
it now seems to work with GTK theme too
2. added checkbox bitmaps drawing under GTK


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-08 14:34:12 +00:00
Vadim Zeitlin
925f7f2250 1. kbd handling in wxListBox seems to work
2. added beginning of wxCheckBox


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-07 23:17:09 +00:00
Vadim Zeitlin
e90a2986c7 1. clip the DC from wxEraseEvent under GTK - now redrawing works there too
2. added wxColourScheme::GetBackground() - still testing
3. implemented (but it is slightly broken) extended listbox interface


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-06 22:12:27 +00:00
Vadim Zeitlin
d0b9653f6c attempts to fix GTK refresh - completely fruitless so far
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-05 19:21:57 +00:00
Vadim Zeitlin
f85b3ee981 renamed m_clientData to fix compilation problems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-05 19:17:17 +00:00
Vadim Zeitlin
8d400a3a23 1. added GetClientAreaOrigin to wxWindow, calculations everywhere use it
2. added horz scrolling to the listbox and fixed thevertical one
3. added wxALWAYS_SHOW_SB (a.k.a. wxLB_ALWAYS_SB) style
4. corrected thumb size calculations


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-03 23:55:28 +00:00
Vadim Zeitlin
4d437f4b2b wxListBox input handling works for single and multi selection ones (not
extended yet)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-02 20:16:04 +00:00
Vadim Zeitlin
afcd76dae8 attemps to make listbox refreshing to work - failed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-01 20:17:10 +00:00
Vadim Zeitlin
7ba00152a6 wxScrollBar drawing seems to work for wxGTK too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-01 19:27:58 +00:00
Vadim Zeitlin
5096d88d2f tons of changes:
1. wxListBox class added
2. wxInputHandler rewritten (Map() -> Handle())
3. wxScrollBar redrawing completely changed


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-09-01 12:58:36 +00:00
Vadim Zeitlin
06be91840a more attempts to make wxScrolledWindow to work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-29 21:13:47 +00:00
Vadim Zeitlin
2026a23167 (completely failed so far) attempt to make wxScrolledWindow work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-28 20:58:06 +00:00
Vadim Zeitlin
e4ced7154b crash when trying to scroll the thumb which can't be scrolled fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-27 17:09:58 +00:00
Vadim Zeitlin
dac7332cc2 added scrolling support to wxWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-27 17:00:42 +00:00
Vadim Zeitlin
bd9218ba08 1. introduced wxUniversal::wxWindow and moved wxControl drawing to it
2. wxStaticBox is more GTK-ish


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-27 15:42:15 +00:00
Vadim Zeitlin
c21be757d6 1. fixed wxEraseEvent in wxGTK
2. compilation fixes for Unix


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-27 12:18:37 +00:00
Vadim Zeitlin
90909d6032 forgotten files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-26 21:35:35 +00:00
Vadim Zeitlin
e24eca174c 1. all recently added classes work under Windows
2. scrollbar input handling improved, should be fine now
3. sample gets the theme name from the cmd line


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-26 21:34:35 +00:00
Vadim Zeitlin
1a1edfc0ca wxBitmapButton added (doesn't work yet)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-25 21:45:03 +00:00
Vadim Zeitlin
325443b96b added wxStaticLine and wxStaticBitmap
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-25 17:46:17 +00:00
Vadim Zeitlin
a360b8503e wxScrollBar for wxGTK done
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-24 20:28:33 +00:00
Vadim Zeitlin
89196a1dab more scrollbar input handling: extracted common bits to wxStdScrollBarHandler
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8174 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-24 12:12:35 +00:00
Vadim Zeitlin
46f2baf74e 1. added wxRenderer::StandardHitTestScrollbar
2. started implementing wxMSW scrollbar input handling


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-23 22:41:00 +00:00
Vadim Zeitlin
2c0eba5f88 1. wxInputHandler now knows about wxRenderer and uses it
2. wxInputHandler::OnMouseMove() added
3. wxGTKRenderer (almost) draws scrollbars
4. scrollbar mouse handling starts to work


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-22 17:02:00 +00:00
Vadim Zeitlin
efe51556de 1. (trivial) wxGTKColourScheme added
2. wxScrollBar draws almost fine under GTK


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-21 19:14:58 +00:00
Vadim Zeitlin
53cec79bbc forgotten files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-20 22:21:22 +00:00
Vadim Zeitlin
bc60c3d699 1. wxColourScheme used by Win32 renderer
2. wxScrollBar half implemented (drawing only)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-20 22:19:41 +00:00
Vadim Zeitlin
ddee3ee64d added wxColourScheme
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-19 20:26:01 +00:00
Vadim Zeitlin
8f2ea39e1d 1. wxInputHandler::Map() can return a sequence of actions, not only one
2. wxControl::PerformAction() takes a wxEvent parameter
3. wxGTK fix: send enter/leave events even when the mouse is captured
4. renamed "highlighted" state to "current"


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-19 19:26:27 +00:00
Vadim Zeitlin
4dc12a1a28 added (half working) wxGTKRenderer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-18 19:05:02 +00:00
Vadim Zeitlin
3b2555e2d0 added wxInputHandler and initial support for it in wxControl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-18 17:33:09 +00:00
Vadim Zeitlin
be1f93ab87 Unix compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-16 18:38:01 +00:00
Vadim Zeitlin
4d3c4c2f94 1. wxStaticText, wxStaticBox, wxButton drawing implemented
2. "pseudo dynamic" wxTheme creation
3. hack to solve GetBestSize() problem
4. more methods in wxDC:: GetMultiLineTextExtent(), DrawLabel()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-15 20:42:47 +00:00
Vadim Zeitlin
9df4cddfa8 added univ dir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-14 19:09:19 +00:00
Vadim Zeitlin
255792efdb more files added
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-14 19:08:46 +00:00
Vadim Zeitlin
c9278366ee removed wxUniversalWindow class and merged its methods into wxWindow itself,
wxGTK builds with the generic wxStaticText enabled (but doesn't work...)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-14 19:08:04 +00:00
Vadim Zeitlin
04e2f7e395 wxMSW builds in minimal configuration (i.e. without anything)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-14 11:48:39 +00:00
Vadim Zeitlin
f84d752df6 wxUniv demo created
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-11 13:18:39 +00:00
Vadim Zeitlin
eeb2c17a67 the library and the sample build with everything off, various wxUSE_XXX
options now really take effect (i.e. can be disabled without breaking
compilation)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-11 13:16:58 +00:00
Vadim Zeitlin
65ab4b2f93 ci test 2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-11 13:14:51 +00:00
Vadim Zeitlin
38824a7bf7 testing logging (2)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-11 12:58:57 +00:00
Bryan Petty
d020d746c4 This commit was manufactured by cvs2svn to create branch 'wxUNIVERSAL'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-08-11 12:58:57 +00:00
3 changed files with 4395 additions and 80 deletions

View File

@@ -1,80 +0,0 @@
dnl
dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN(AM_PATH_CPPUNIT,
[
AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
cppunit_config_prefix="$withval", cppunit_config_prefix="")
AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
if test x$cppunit_config_exec_prefix != x ; then
cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
fi
fi
if test x$cppunit_config_prefix != x ; then
cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
if test x${CPPUNIT_CONFIG+set} != xset ; then
CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
fi
fi
AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
cppunit_version_min=$1
AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
no_cppunit=""
if test "$CPPUNIT_CONFIG" = "no" ; then
no_cppunit=yes
else
CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
cppunit_version=`$CPPUNIT_CONFIG --version`
cppunit_major_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_version=`echo $cppunit_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_major_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
cppunit_minor_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
cppunit_micro_min=`echo $cppunit_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
cppunit_version_proper=`expr \
$cppunit_major_version \> $cppunit_major_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \> $cppunit_minor_min \| \
$cppunit_major_version \= $cppunit_major_min \& \
$cppunit_minor_version \= $cppunit_minor_min \& \
$cppunit_micro_version \>= $cppunit_micro_min `
if test "$cppunit_version_proper" = "1" ; then
AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
else
AC_MSG_RESULT(no)
no_cppunit=yes
fi
fi
if test "x$no_cppunit" = x ; then
ifelse([$2], , :, [$2])
else
CPPUNIT_CFLAGS=""
CPPUNIT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
])

514
include/wx/univ/textctrl.h Normal file
View File

@@ -0,0 +1,514 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/univ/textctrl.h
// Purpose: wxTextCtrl class
// Author: Vadim Zeitlin
// Modified by:
// Created: 15.09.00
// RCS-ID: $Id$
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UNIV_TEXTCTRL_H_
#define _WX_UNIV_TEXTCTRL_H_
#ifdef __GNUG__
#pragma interface "univtextctrl.h"
#endif
class WXDLLEXPORT wxCaret;
class WXDLLEXPORT wxTextCtrlCommandProcessor;
#include "wx/scrolwin.h" // for wxScrollHelper
#include "wx/univ/inphand.h"
// ----------------------------------------------------------------------------
// wxTextCtrl actions
// ----------------------------------------------------------------------------
// cursor movement and also selection and delete operations
#define wxACTION_TEXT_GOTO _T("goto") // to pos in numArg
#define wxACTION_TEXT_FIRST _T("first") // go to pos 0
#define wxACTION_TEXT_LAST _T("last") // go to last pos
#define wxACTION_TEXT_HOME _T("home")
#define wxACTION_TEXT_END _T("end")
#define wxACTION_TEXT_LEFT _T("left")
#define wxACTION_TEXT_RIGHT _T("right")
#define wxACTION_TEXT_UP _T("up")
#define wxACTION_TEXT_DOWN _T("down")
#define wxACTION_TEXT_WORD_LEFT _T("wordleft")
#define wxACTION_TEXT_WORD_RIGHT _T("wordright")
#define wxACTION_TEXT_PAGE_UP _T("pageup")
#define wxACTION_TEXT_PAGE_DOWN _T("pagedown")
// clipboard operations
#define wxACTION_TEXT_COPY _T("copy")
#define wxACTION_TEXT_CUT _T("cut")
#define wxACTION_TEXT_PASTE _T("paste")
// insert text at the cursor position: the text is in strArg of PerformAction
#define wxACTION_TEXT_INSERT _T("insert")
// if the action starts with either of these prefixes and the rest of the
// string is one of the movement commands, it means to select/delete text from
// the current cursor position to the new one
#define wxACTION_TEXT_PREFIX_SEL _T("sel")
#define wxACTION_TEXT_PREFIX_DEL _T("del")
// mouse selection
#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel")
#define wxACTION_TEXT_EXTEND_SEL _T("extendsel")
#define wxACTION_TEXT_SEL_WORD _T("wordsel")
#define wxACTION_TEXT_SEL_LINE _T("linesel")
// undo or redo
#define wxACTION_TEXT_UNDO _T("undo")
#define wxACTION_TEXT_REDO _T("redo")
// ----------------------------------------------------------------------------
// wxTextCtrl types
// ----------------------------------------------------------------------------
// wxTextPos is the position in the text
typedef long wxTextPos;
// wxTextCoord is the line or row number (which should have been unsigned but
// is long for backwards compatibility)
typedef long wxTextCoord;
// ----------------------------------------------------------------------------
// wxTextCtrl::HitTest return values
// ----------------------------------------------------------------------------
// the point asked is ...
enum wxTextCtrlHitTestResult
{
wxTE_HT_BEFORE = -1, // either to the left or upper
wxTE_HT_ON_TEXT, // directly on
wxTE_HT_BELOW, // below [the last line]
wxTE_HT_BEYOND // after [the end of line]
};
// ... the character returned
// ----------------------------------------------------------------------------
// wxTextCtrl
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase, public wxScrollHelper
{
public:
// creation
// --------
wxTextCtrl() { Init(); }
wxTextCtrl(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr)
{
Init();
Create(parent, id, value, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr);
virtual ~wxTextCtrl();
// implement base class pure virtuals
// ----------------------------------
virtual wxString GetValue() const;
virtual void SetValue(const wxString& value);
virtual int GetLineLength(wxTextCoord lineNo) const;
virtual wxString GetLineText(wxTextCoord lineNo) const;
virtual int GetNumberOfLines() const;
virtual bool IsModified() const;
virtual bool IsEditable() const;
// If the return values from and to are the same, there is no selection.
virtual void GetSelection(wxTextPos* from, wxTextPos* to) const;
// operations
// ----------
// editing
virtual void Clear();
virtual void Replace(wxTextPos from, wxTextPos to, const wxString& value);
virtual void Remove(wxTextPos from, wxTextPos to);
// clears the dirty flag
virtual void DiscardEdits();
// writing text inserts it at the current position, appending always
// inserts it at the end
virtual void WriteText(const wxString& text);
virtual void AppendText(const wxString& text);
// translate between the position (which is just an index in the text ctrl
// considering all its contents as a single strings) and (x, y) coordinates
// which represent (logical, i.e. unwrapped) column and line.
virtual wxTextPos XYToPosition(wxTextCoord x, wxTextCoord y) const;
virtual bool PositionToXY(wxTextPos pos,
wxTextCoord *x, wxTextCoord *y) const;
// wxUniv-specific: find a screen position (in client coordinates) of the
// given text position or of the caret
bool PositionToLogicalXY(wxTextPos pos, wxCoord *x, wxCoord *y) const;
bool PositionToDeviceXY(wxTextPos pos, wxCoord *x, wxCoord *y) const;
wxPoint GetCaretPosition() const;
virtual void ShowPosition(wxTextPos pos);
// Clipboard operations
virtual void Copy();
virtual void Cut();
virtual void Paste();
// Undo/redo
virtual void Undo();
virtual void Redo();
virtual bool CanUndo() const;
virtual bool CanRedo() const;
// Insertion point
virtual void SetInsertionPoint(wxTextPos pos);
virtual void SetInsertionPointEnd();
virtual wxTextPos GetInsertionPoint() const;
virtual wxTextPos GetLastPosition() const;
virtual void SetSelection(wxTextPos from, wxTextPos to);
virtual void SetEditable(bool editable);
// wxUniv-specific methods
// -----------------------
// caret stuff
virtual void ShowCaret(bool show = TRUE);
void HideCaret() { ShowCaret(FALSE); }
void CreateCaret(); // for the current font size
// helpers for cursor movement
wxTextPos GetWordStart() const;
wxTextPos GetWordEnd() const;
// selection helpers
bool HasSelection() const
{ return m_selStart != -1 && m_selEnd > m_selStart; }
void ClearSelection();
void RemoveSelection();
wxString GetSelectionText() const;
// find the character at this position, return 0 if the character is
// really there, -1 if the point is before the beginning of the text/line
// and the returned character is the first one to follow it or +1 if it the
// position is beyond the end of line/text and the returned character is
// the last one
//
// NB: pt is in device coords (not adjusted for the client area origin nor
// for the scrolling)
wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
wxTextCoord *col, wxTextCoord *row) const;
// find the character at this position in the given line, return value as
// for HitTest()
//
// NB: x is the logical coord (client and unscrolled)
wxTextCtrlHitTestResult HitTestLine(const wxString& line,
wxCoord x,
wxTextCoord *colOut) const;
// bring the given position into view
void ShowHorzPosition(wxCoord pos);
// scroll the window horizontally so that the first character shown is in
// position pos
void ScrollText(wxTextCoord col);
// adjust the DC for horz text control scrolling too
virtual void DoPrepareDC(wxDC& dc);
// implementation only from now on
// -------------------------------
// override this to take into account our scrollbar-less scrolling
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// set the right colours and border
virtual bool IsContainerWindow() const { return TRUE; }
virtual wxBorder GetDefaultBorder() const { return wxBORDER_SUNKEN; }
// perform an action
virtual bool PerformAction(const wxControlAction& action,
long numArg = -1,
const wxString& strArg = wxEmptyString);
// override these methods to handle the caret
virtual bool SetFont(const wxFont &font);
virtual bool Enable(bool enable = TRUE);
protected:
// draw the text
void DrawTextLine(wxDC& dc, const wxRect& rect,
const wxString& text,
wxTextPos selStart, wxTextPos selEnd);
void DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate);
// override base class methods
virtual void DoDrawBorder(wxDC& dc, const wxRect& rect);
virtual void DoDraw(wxControlRenderer *renderer);
// calc the size from the text extent
virtual wxSize DoGetBestClientSize() const;
// input support
virtual wxString GetInputHandlerType() const;
// common part of all ctors
void Init();
// more readable flag testing methods
bool IsSingleLine() const { return !(GetWindowStyle() & wxTE_MULTILINE); }
bool IsPassword() const { return (GetWindowStyle() & wxTE_PASSWORD) != 0; }
bool WrapLines() const
{ return !IsSingleLine() && !(GetWindowStyle() & wxHSCROLL); }
// get the extent (width) of the text
wxCoord GetTextWidth(const wxString& text) const;
// get the logical text width (accounting for scrolling)
wxCoord GetTotalWidth() const;
// find the number of rows in this line (only if WrapLines())
wxTextCoord GetRowsPerLine(wxTextCoord line) const;
// get total number of rows before the given line
wxTextCoord GetNumberOfRowsBefore(wxTextCoord line) const;
// the text area is the part of the window in which the text can be
// displayed, i.e. part of it inside the margins and the real text area is
// the area in which the text *is* currently displayed: for example, in the
// multiline control case the text area can have extra space at the bottom
// which is not tall enough for another line and which is then not included
// into the real text area
wxRect GetRealTextArea() const;
// refresh the text in the given (in logical coords) rect
void RefreshTextRect(const wxRect& rect);
// refresh the text in the given range (in logical coords) of this line, if
// width is 0, refresh to the end of line
void RefreshPixelRange(wxTextCoord line, wxCoord start, wxCoord width);
// refresh the text in the given range (in text coords) in this line
void RefreshColRange(wxTextCoord line, wxTextPos start, size_t count);
// refresh the text from in the given line range (inclusive)
void RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast);
// refresh the text in the given range which can span multiple lines
// (this method accepts arguments in any order)
void RefreshTextRange(wxTextPos start, wxTextPos end);
// get the text to show: either the text itself or the text replaced with
// starts for wxTE_PASSWORD control
wxString GetTextToShow(const wxString& text) const;
// find the number of characters of a line before it wraps
// (and optionally also the real width of the line)
size_t GetPartOfWrappedLine(const wxChar* text,
wxCoord *widthReal = NULL) const;
// get the start and end of the selection for this line: if the line is
// outside the selection, both will be -1 and FALSE will be returned
bool GetSelectedPartOfLine(wxTextCoord line,
wxTextPos *start, wxTextPos *end) const;
// update the text rect: the zone inside our client rect (its coords are
// client coords) which contains the text
void UpdateTextRect();
// calculate the last visible position
void UpdateLastVisible();
// move caret to the given position unconditionally
// (SetInsertionPoint() does nothing if the position didn't change)
void DoSetInsertionPoint(wxTextPos pos);
// set the caret to its initial (default) position
void InitInsertionPoint();
// get the width of the longest line in pixels
wxCoord GetMaxWidth() const;
// force recalculation of the max line width
void RecalcMaxWidth();
// update the max width after the given line was modified
void UpdateMaxWidth(wxTextCoord line);
// HitTest2() is more efficient than 2 consecutive HitTest()s with the same
// line (i.e. y) and it also returns the offset of the starting position in
// pixels
//
// as the last hack, this function accepts either logical or device (by
// default) coords depending on devCoords flag
wxTextCtrlHitTestResult HitTest2(wxCoord y,
wxCoord x1,
wxCoord x2,
wxTextCoord *row,
wxTextCoord *colStart,
wxTextCoord *colEnd,
wxTextCoord *colRowStart,
bool devCoords = TRUE) const;
// HitTest() version which takes the logical text coordinates and not the
// device ones
wxTextCtrlHitTestResult HitTestLogical(const wxPoint& pos,
wxTextCoord *col,
wxTextCoord *row) const;
// get the height of one line (the same for all lines)
wxCoord GetLineHeight() const
{
// this one should be already precalculated
wxASSERT_MSG( m_heightLine != -1, _T("should have line height") );
return m_heightLine;
}
// get the average char width
wxCoord GetAverageWidth() const { return m_widthAvg; }
// recalc the line height and char width (to call when the font changes)
void RecalcFontMetrics();
// event handlers
void OnIdle(wxIdleEvent& event);
void OnChar(wxKeyEvent& event);
void OnSize(wxSizeEvent& event);
// return the struct containing control-type dependent data
struct wxTextSingleLineData& SData() { return *m_data.sdata; }
struct wxTextMultiLineData& MData() { return *m_data.mdata; }
const wxTextSingleLineData& SData() const { return *m_data.sdata; }
const wxTextMultiLineData& MData() const { return *m_data.mdata; }
// accessors for derived classes (SL stands for single line)
const wxString& GetSLValue() const
{
wxASSERT_MSG( IsSingleLine(), _T("only for single line controls") );
return m_value;
}
void SetSLValue(const wxString& value)
{
wxASSERT_MSG( IsSingleLine(), _T("only for single line controls") );
m_value = value;
}
// clipboard operations (unlike the versions without Do prefix, they have a
// return code)
bool DoCut();
bool DoPaste();
private:
// update the scrollbars (only called from OnIdle)
void UpdateScrollbars();
// the initially specified control size
wxSize m_sizeInitial;
// the control text (only used for single line controls)
wxString m_value;
// current position
wxTextPos m_curPos;
wxTextCoord m_curCol,
m_curRow;
// last position (only used by GetLastPosition())
wxTextPos m_posLast;
// selection
wxTextPos m_selAnchor,
m_selStart,
m_selEnd;
// flags
bool m_isModified:1,
m_isEditable:1,
m_hasCaret:1;
// the rectangle (in client coordinates) to draw text inside
wxRect m_rectText;
// the height of one line (cached value of GetCharHeight)
wxCoord m_heightLine;
// and the average char width (cached value of GetCharWidth)
wxCoord m_widthAvg;
// we have some data which depends on the kind of control (single or multi
// line)
union
{
wxTextSingleLineData *sdata;
wxTextMultiLineData *mdata;
void *data;
} m_data;
// the object to which we delegate our undo/redo implementation
wxTextCtrlCommandProcessor *m_cmdProcessor;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
};
// ----------------------------------------------------------------------------
// wxStdTextCtrlInputHandler: this control handles only the mouse/kbd actions
// common to Win32 and GTK, platform-specific things are implemented elsewhere
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxStdTextCtrlInputHandler : public wxStdInputHandler
{
public:
wxStdTextCtrlInputHandler(wxInputHandler *inphand);
virtual bool HandleKey(wxControl *control,
const wxKeyEvent& event,
bool pressed);
virtual bool HandleMouse(wxControl *control,
const wxMouseEvent& event);
virtual bool HandleMouseMove(wxControl *control,
const wxMouseEvent& event);
virtual bool HandleFocus(wxControl *control, const wxFocusEvent& event);
protected:
// get the position of the mouse click
static wxTextPos HitTest(const wxTextCtrl *text, const wxPoint& pos);
// capture data
wxTextCtrl *m_winCapture;
};
#endif // _WX_UNIV_TEXTCTRL_H_

3881
src/univ/textctrl.cpp Normal file

File diff suppressed because it is too large Load Diff