Benjamin I. Williams
Currently there is no way of receiving notification
that a user cancelled an edit operation on a wxTreeCtrl
tree node label.
This patch adds a method "IsEditCancelled" to the
wxTreeEvent class. During an EVT_TREE_END_LABEL_EDIT
event, the programmer can now determine whether or not
the edit operation was cancelled by the user (by
pressing <ESC>).
This patch provides this implementation for both
wxMSW's wxTreeCtrl and the wxGenericTreeCtrl. Both
situations have been tested and work well.
The patch is not very invasive, and is much smaller
than I had expected.
Please see the relevent discussion on the wx-dev list
for more details.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Benjamin I. Williams
This patch implements three new flags for the
wxTextCtrl control. The flags are wxTE_LEFT,
wxTE_CENTRE, and wxTE_RIGHT. These flags can change
the way text is aligned inside an edit control, which
is useful when the user is editing numbers or dates.
At Vadim's recommendation, the patch implements the
alignment flags so they are equal to the corresponding
wxALIGN_* value. wxTE_LEFT is actually 0x0000, and is
just a place holder. wxTE_CENTRE is equal to
wx_ALIGN_CENTER_HORIZONTAL (0x0100), and wxTE_RIGHT is
equal to wxALIGN_RIGHT (0x0100). I couldn't agree more
with this idea.
As Vadim pointed out, choosing to set the text
alignment flags to the corresponding wxALIGN_* flags
has a slight negative side effect: the values 0x0100
and 0x0200 collide with the existing flags
wxTE_NO_VSCROLL and wxTE_AUTO_SCROLL. A valid point
was raised, however, which stated that the flags would
never really be used at the same time, and also that
wxTE_AUTO_SCROLL is (possibly) going to be deprecated
anyway.
While this collision is not really a problem, I didn't
like the idea of someone specifying wxTE_NO_VSCROLL and
ending up with with a centered text control ! Thus, I
chose to move both wxTE_NO_VSCROLL and wxTE_AUTO_SCROLL
down to the free bits 0x0002 and 0x0008, respectively.
I'll leave the final say up to Vadim and the rest of
you whether you want to move these flags down or keep
them where they are (with collisions). What truly
matters to me is that I can now create text controls
with the proper alignment!
This patch also updates the documentation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
1. works correctly (handles negative widths according to the docs/MSW/Univ)
2. has shorter and simpler GetFieldRect() implementation
3. ... which is also more efficient (pixel widths are cached)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By Michael Fielding
As discussed on wx-dev. some fixes and improvements for Interprocess Communication (IPC), using DDE and TCP.
1. DDE buffers were using a global buffer
2. TCP buffers were allocated each time needed, and Request would have caused memory leaks had it been used.
Fixed these both by using a self-resizing buffer in wxConnectionBase. Changed samples and docs to reflect the improved (but backward compatible) internal buffer management. wxConnectionBase could (in future) use wxMemoryBuffer.
3. IPC sample had trouble closing, causing crash, when closing server using window X button.
Because it was (effectively) trying to delete a window in OnExit, when that window was already destroyed. Fixed by making IPCDialog and MyConnection remember if they'd destroyed each other. It's not elegant, but either the connection or the window could be deleted first.
4. Docs for wxDDE... and wxTCP... duplicated eachother, supposed to have same API. Some parts unclear.
Patch removes dde and tcp-specific files (including from tipc.tex and classes.tex), and explains how ipc.h selects for you which one to use based on platform. Some other misc clarifications.
6. Client sample was suffering apparent memory leak because of not deleting connection object, and had a hack in there to do that.
In fact this was due to the derived OnDisconnect not deleting itself, as it does in base class. Mentioned need to do it in docs, fixed sample so that it does.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By Robert O'Connor
This is a patch to wxTip Provider classes used by the "Tip of the day" dialog.
See wx-dev archives August 2002 for discussion of the functionality design.
It does 5 things:
-Support for comments inside the tips file. The pound character (#) is used, as recommended by Vadim.
-Allows optional easy translation support to tips, by marking them as translatable for gettext, by enclosing them in a _(""). Program will translate these tips at runtime from the active catalog.
-Blank lines or lines with just spaces are automatically skipped (I had to put this in, I keep wondering why I get blank tips sometimes and it is because the text file had a empty blank line at the end of the text file).
-There is a pluggable virtual function to preprocess to modify the tip in a derived class, in case something specialized is desired, such as variable expansion, etc, as recommended by Julian and Vadim.
-Now resets the tip counter if the previous tip is past the end of the file (ie you removed some tips, or changed tip files), as discussed on wx-dev.
This patch updates:
-The classes.
-The class documentation and the Tip-of-the-day topic overview documentation.
-The dialogs example, placing some new strings for the tips.txt file which demonstrate how to use the Tip-of-the-day features for in practice.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Proposed fixes for the wxWindows joystick code under
MSW.
Some of these would be valid for other platforms, too.
Events for buttons are named wrong, docs say different.
Docs say EVT_JOY_BUTTON_DOWN and
EVT_JOY_BUTTON_UP,
but the code says EVT_JOY_DOWN and EVT_JOY_UP. I
suggest
changing the code to match the docs.
wxJoystick::GetNumberJoysticks() should be a static
member
function. Having to create a joystick object to see if there
are joysticks is silly.
Docs for GetNumberJoysticks() must be changed; it returns
the
number of potentially connected joysticks, not the number of
actually connected. Alternatively, GetNumberJoysticks() and
others must be rewritten to conform with documentation,
including
remapping of wxWindows sequential joystick ID's to match
MSW non-sequential joystick ID's.
dwSize is not set when joyGetPosEx() is called. SEVERE
ERROR.
Error return value from functions should not be a legal
return,
for instance, wxJoystick::GetPOVCTSPosition() returns 0
for error,
but this is a legal return value.
GetButtonState() supports only four (out of 32) buttons.
Also, should return as bitmap (LSB = button 1). (Win32
does this,
although not documented as such).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
By Hans Van Leemputten (hansvl)
- This patch implements a generic notebook based mdi,
due to that wxMDIChildFrame could not derive from
wxFrame some things in the samples and in the docmdi
classes needed to be adjusted... basically this comes
down to not do (wxFrame *) but instead do
(wxMDIChildFrame *), or store a pointer to the frame in a
wxWindow* instead of a wxFrame variable...
- The main reason wxMDIChildFrame cannot derive from
wxFrame is that it would take to much platform specific
functions to be overwritten (= lot of ifdef's). This then
couldn't be called generic anymore, so that's why we
need to derive from wxPanel...
- Tested on/with:
1. wxMSW (I disabled the MSW MDI implementation to
be able to test it), tested it with the MDI sample,
docvwmdi sample and docview sample and also tested it
with wxWorkshop. (test = compile and run)
2. wxX11, tested with the same set wxWin samples as
the wxMSW test. I also compiled wxWorkshop with it,
but could not run wxWorkshop due to some issue not
related to the MDI implementation.
- How to apply:
* Apply the patch
* move mdig.cpp into wxWindows/src/generic/
* move mdig.h into wxWindows/include/wx/generic/
- Some extra things that still need to be done:
* File lists, project files should be updated to include
mdig.cpp (the patch only change this on wxX11)
* The configuration script should be updated.
* Maybe wxUSE_GENERIC_MDI_ARCHITECTURE also
should be added so it is only included when wanted...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows changing the padding of the icons and text
in the tab of a wxNotebook for wxGTK.
Since the container in the tab is only a horizontal
container only the width component is used. Negative
values are acceptable so no checks were made.
It now defaults to a padding of 0 on the sides and 1 in
between the icon and label, looks good for a few
"themes" I tried.
Note: Unfortunately there is no function to set the
padding on the left or right side of a widget.
gtk_box_set_child_packing sets padding on BOTH sides of
a widget so you'd get double the spacing between an
icon and the label. To get around this, the icon (if
there was one) is removed and added back. That way the
icon will provide the padding on the left and the label
will provide the padding between and to the right. It
looks nice for all sizes. The
gtk_container_set_border_width unforuntately only adds
borders to ALL sides equally.
A simple check is to add m_notebook->SetPadding in one
in the spinctrl callback in the controls sample. (set
appropriate range too -10,20). Note that the tab sizes
change to fit the width of the panel, if appropriate,
and so the spacing between the icon and label changes
accordingly. This isn't a bug, but it does look weird
as you scan up and down the spacing (which nobody would
normally do).
I also changed all wxGtkNotebookPage variables to
nb_page so that "int page" would be used to mean the
page number. Just cosmetic for consistency with the
rest of the functions that were already like that.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This patch updates the CW section in
docs/msw/install.txt for the development (2.3.3) branch.
It fixes a couple typos and clarifies how to use the
minimal project file as a template for other projects.
Igor Mikolic-Torreira
igormt@alumni.caltech.edu
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Generic wxListCtrl renamed to wxGenericListCtrl, wxImageList
renamed to wxGenericImageList, so they can be used on wxMSW
(Rene Rivera).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16250 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxHelpProvider::RemoveHelp, which is now called from ~wxWindowBase.
Without cleaning up the hash tables, reused window addresses will cause
the CS help to fail rather comically over time.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775