Compare commits
351 Commits
before_gtk
...
ACARC_2006
Author | SHA1 | Date | |
---|---|---|---|
|
1b86aa9d7a | ||
|
d4a2ae7a13 | ||
|
bebf40d5a0 | ||
|
b21348b405 | ||
|
9b70ed7b55 | ||
|
4c9847e14e | ||
|
b271d60d6a | ||
|
548bbe143b | ||
|
c1d8296a78 | ||
|
e88df737fb | ||
|
8aeeb05c0e | ||
|
4ad76303b5 | ||
|
8875e7ad84 | ||
|
dddd1f21c1 | ||
|
cc11ded1ae | ||
|
9ad34f611f | ||
|
2cdf244521 | ||
|
8ced02f601 | ||
|
891ace0538 | ||
|
9cd03a43ce | ||
|
7532f691fb | ||
|
38c39207e9 | ||
|
0e3c83a736 | ||
|
650372cf91 | ||
|
6e9e2d94b4 | ||
|
78c743d864 | ||
|
63de3718ed | ||
|
7553e636a2 | ||
|
66d84d1130 | ||
|
3d971ca9f1 | ||
|
bb86baea10 | ||
|
370d2fd7cc | ||
|
bc6ee4ae7f | ||
|
0df4335d4d | ||
|
2c62259349 | ||
|
0c38974967 | ||
|
86f6a6d19d | ||
|
717870a64c | ||
|
119f7bb745 | ||
|
5ff751d600 | ||
|
4647fc0833 | ||
|
aae53500af | ||
|
50a32a83d7 | ||
|
412e0d47c0 | ||
|
84ac8772b7 | ||
|
67d0bba631 | ||
|
233c6e7fb0 | ||
|
ab0f0eddc4 | ||
|
7ede73899d | ||
|
1599f54eaa | ||
|
46bed958ef | ||
|
f885b81573 | ||
|
69d313011b | ||
|
9941146580 | ||
|
21ec3bf99c | ||
|
90e572f1e5 | ||
|
8b28584104 | ||
|
7db33dd7ad | ||
|
0ab48d6405 | ||
|
f0f60c7c21 | ||
|
3bc7a423ad | ||
|
97eac136f3 | ||
|
46cbb21ecb | ||
|
1ac74d83a3 | ||
|
8b0df0e138 | ||
|
5e06d749ed | ||
|
582ca3535a | ||
|
dbc459f652 | ||
|
d997c6118c | ||
|
0f99ce3d75 | ||
|
6716099174 | ||
|
f784a2a96b | ||
|
c9eee7f035 | ||
|
58b59bb7d5 | ||
|
f000211ebe | ||
|
c0089c96ec | ||
|
41ab357ed9 | ||
|
4b764db379 | ||
|
3d1a1d2df6 | ||
|
5fd420ed86 | ||
|
d126840117 | ||
|
83cda8eb0a | ||
|
394b206f07 | ||
|
c1da50582e | ||
|
0118b60be6 | ||
|
94e8d77cbb | ||
|
ce82ff93d3 | ||
|
08b9726806 | ||
|
6fa30495b5 | ||
|
db9db9cd18 | ||
|
f302b6a445 | ||
|
0519aac9db | ||
|
ece291c7d2 | ||
|
306b6fe972 | ||
|
6d3d756a6a | ||
|
2a2d7a737d | ||
|
b0b4386b6e | ||
|
8735500383 | ||
|
5b897d36cc | ||
|
ffd84c9476 | ||
|
75865c8dc7 | ||
|
e710277282 | ||
|
b2f8e75a0a | ||
|
3c3e697033 | ||
|
d0e7c7e589 | ||
|
19d7aad6f2 | ||
|
6dabe332cb | ||
|
7ec698211d | ||
|
2a4d2d4680 | ||
|
b46d37d75c | ||
|
e00eeba851 | ||
|
8ec0a8fa72 | ||
|
5c60e84569 | ||
|
0567fdfceb | ||
|
47bff9ff8b | ||
|
92641c0dc0 | ||
|
c8d5853155 | ||
|
4c4863dbe7 | ||
|
5ec5e8cedb | ||
|
70dec69b0b | ||
|
af52e1853c | ||
|
8d8d36335c | ||
|
793b53a004 | ||
|
75e275af32 | ||
|
2175898cf6 | ||
|
67eb4cb253 | ||
|
f4b3287fd2 | ||
|
a6de78177e | ||
|
1e966cc4c8 | ||
|
153958f72d | ||
|
2ee96a251c | ||
|
6dc2a916df | ||
|
8fb824187d | ||
|
015dca24ca | ||
|
56aed4aace | ||
|
d37e85cd9b | ||
|
fd39aa23bc | ||
|
44f9d0aa55 | ||
|
f51374fe9d | ||
|
d4bd6c97be | ||
|
26a2f9144b | ||
|
d32be04cd7 | ||
|
51cdab3ef8 | ||
|
57a21e6c45 | ||
|
fb5246bead | ||
|
cdc059191b | ||
|
ce045aed58 | ||
|
f3e874756b | ||
|
caae22fb66 | ||
|
41e155b43e | ||
|
792f83f038 | ||
|
377a6b3ef5 | ||
|
18b94824f5 | ||
|
316189733a | ||
|
24cd6f8250 | ||
|
bf00c875fe | ||
|
6270539bcf | ||
|
3ca57155b4 | ||
|
743e24aa72 | ||
|
c032d94e60 | ||
|
46ae103b9f | ||
|
72c23f8e29 | ||
|
340bfb43eb | ||
|
5bc3865fdf | ||
|
2ea5111b0a | ||
|
cb8cc2506b | ||
|
d40209bbc4 | ||
|
34097680c0 | ||
|
7996ff8038 | ||
|
3e764e2f80 | ||
|
dbf38e885e | ||
|
faa49bfd39 | ||
|
60fef9643d | ||
|
64bd657c27 | ||
|
fa349e95cc | ||
|
391e89ae17 | ||
|
6aad0c7037 | ||
|
1fdc16adf7 | ||
|
552271d6ad | ||
|
b4a12e485b | ||
|
6b5a2b6fe9 | ||
|
4b39770c38 | ||
|
44aa865dfc | ||
|
ce0d1032d1 | ||
|
6567c540f5 | ||
|
4262d65eb1 | ||
|
63c02113db | ||
|
60ff2335c4 | ||
|
60104cbafa | ||
|
4b8f856e6f | ||
|
b7859132ae | ||
|
e4809643b4 | ||
|
f9f75df733 | ||
|
91a1ee8637 | ||
|
136b3b1914 | ||
|
127eab18f8 | ||
|
b8af111fa5 | ||
|
fcdbeefa4e | ||
|
ddc2587f4a | ||
|
1f00af0e9e | ||
|
ae0ca7559c | ||
|
a30ccc2d42 | ||
|
6092f24fae | ||
|
7b504551c2 | ||
|
2cb94e7ad6 | ||
|
2c028d8308 | ||
|
b01ca8b6a9 | ||
|
bb0d2f0379 | ||
|
7dab17dd7a | ||
|
a843caf3e1 | ||
|
0ed94e8347 | ||
|
ebefb30e51 | ||
|
d2bad02dbb | ||
|
cb7d73757f | ||
|
ec90484017 | ||
|
3f93a7508e | ||
|
dd9ea234f2 | ||
|
90c0f5a958 | ||
|
3db5226517 | ||
|
b4f9b09cb9 | ||
|
df034cc6d5 | ||
|
9a173d48f7 | ||
|
0bab774ba3 | ||
|
d9f42a9e5a | ||
|
2bc63d3f80 | ||
|
8bda759f44 | ||
|
89220a9428 | ||
|
07f9359380 | ||
|
76bcd8154c | ||
|
068becf562 | ||
|
d9b30c5a6c | ||
|
4d56c20d2c | ||
|
5ccb95f690 | ||
|
9f8b9d9cc1 | ||
|
ebef1625fa | ||
|
2fa7bb014e | ||
|
3708784b46 | ||
|
16bb2e119d | ||
|
fbf618dff8 | ||
|
96531a71a0 | ||
|
554fdf48f5 | ||
|
de5f07794d | ||
|
8869c3a1ce | ||
|
bc88602a65 | ||
|
3d3afaecfb | ||
|
1ca78aa1dc | ||
|
dbeb8eacae | ||
|
2f36e8dce5 | ||
|
a4f4d548ce | ||
|
09f1410821 | ||
|
4708068cb6 | ||
|
9e31a66087 | ||
|
11ef729d54 | ||
|
4837b89e3b | ||
|
c4cd20cfa7 | ||
|
efbf673503 | ||
|
39a1c2f2dd | ||
|
d21423356e | ||
|
c59f6793fb | ||
|
a027779a10 | ||
|
0ad966eeac | ||
|
2ddb4d1358 | ||
|
d8fd7acb8b | ||
|
eb42e596aa | ||
|
ff2baa25d5 | ||
|
4383e2b12a | ||
|
2f27c88987 | ||
|
7383cf9d17 | ||
|
be665c07ab | ||
|
4e09ebe880 | ||
|
dc043de063 | ||
|
4d551ad5e5 | ||
|
907c39f19b | ||
|
169adfa9c4 | ||
|
e4d6cfadda | ||
|
91dea3144c | ||
|
162a4f9382 | ||
|
e191ee8751 | ||
|
1e967276d8 | ||
|
3811368401 | ||
|
7fe8059f58 | ||
|
7f9d2f2aaf | ||
|
2c375f42cf | ||
|
011b3dcbef | ||
|
5d7836c47d | ||
|
65de19d80a | ||
|
2f5e790cb1 | ||
|
14ff1954ae | ||
|
ae999b11ec | ||
|
06c2bab085 | ||
|
159e6235b2 | ||
|
afe1376994 | ||
|
6694ee19fc | ||
|
c3ee2228e5 | ||
|
5d4a10e70a | ||
|
74205969dd | ||
|
871192ce0f | ||
|
4a10ea8b13 | ||
|
c0f420c1ac | ||
|
1a4138c79a | ||
|
22574b4a9c | ||
|
b220b1a2c8 | ||
|
a84d5f9da1 | ||
|
30e105e429 | ||
|
e9ac5f0244 | ||
|
fcd8dd3f33 | ||
|
07319f2aaf | ||
|
6429ac6d63 | ||
|
ab6ea1ac2f | ||
|
e396018def | ||
|
e40b74ba83 | ||
|
d6701f32aa | ||
|
3fc1adbd94 | ||
|
4948c2b6c8 | ||
|
6c1a7bc483 | ||
|
ea75e99e8f | ||
|
a901c3fde9 | ||
|
ac11db3a77 | ||
|
efa5f7095f | ||
|
4483a6ed97 | ||
|
01b8292d11 | ||
|
b71e90034f | ||
|
c1b6178278 | ||
|
e5d92e2bef | ||
|
6495ea3f1d | ||
|
119a60edd3 | ||
|
1fd0e166f3 | ||
|
9f1a446692 | ||
|
b719fd8d81 | ||
|
b2aba33179 | ||
|
b04ada921f | ||
|
2b053ae90a | ||
|
42e53e7771 | ||
|
2cd354c9c6 | ||
|
bc454ef84c | ||
|
3e4f8ee256 | ||
|
46bde8dcf2 | ||
|
4c2a39bec1 | ||
|
642446e3bf | ||
|
8cee4a304f | ||
|
d2dfef5f3f | ||
|
345bdf13c0 | ||
|
6c9ddf03f0 | ||
|
d32e78bd42 | ||
|
87a3ebe978 | ||
|
ee146bca1b | ||
|
bcaab0f92e | ||
|
21a186a1fc | ||
|
583d6b4bd2 | ||
|
89ec5d1421 | ||
|
0ffc92133b |
75
build/aclocal/ac_raf_func_which_getservbyname_r.m4
Normal file
75
build/aclocal/ac_raf_func_which_getservbyname_r.m4
Normal file
@@ -0,0 +1,75 @@
|
||||
dnl @synopsis AC_raf_FUNC_WHICH_GETSERVBYNAME_R
|
||||
dnl
|
||||
dnl Provides a test to determine the correct way to call
|
||||
dnl getservbyname_r:
|
||||
dnl
|
||||
dnl - defines HAVE_FUNC_GETSERVBYNAME_R_6 if it needs 6 arguments (e.g linux)
|
||||
dnl - defines HAVE_FUNC_GETSERVBYNAME_R_5 if it needs 5 arguments (e.g. solaris)
|
||||
dnl - defines HAVE_FUNC_GETSERVBYNAME_R_4 if it needs 4 arguments (e.g. osf/1)
|
||||
dnl
|
||||
dnl An example use can be found at
|
||||
dnl http://raf.org/autoconf/net_getservbyname.c
|
||||
dnl
|
||||
dnl Based on Caolan McNamara's gethostbyname_r macro. Based on David
|
||||
dnl Arnold's autoconf suggestion in the threads faq.
|
||||
dnl
|
||||
dnl @category Misc
|
||||
dnl @author raf <raf@raf.org>
|
||||
dnl @version 2001-08-20
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([AC_raf_FUNC_WHICH_GETSERVBYNAME_R],
|
||||
[AC_CACHE_CHECK(for getservbyname_r, ac_cv_func_which_getservbyname_r, [
|
||||
AC_CHECK_FUNC(getservbyname_r, [
|
||||
AC_TRY_COMPILE([
|
||||
# include <netdb.h>
|
||||
], [
|
||||
|
||||
char *name;
|
||||
char *proto;
|
||||
struct servent *se;
|
||||
struct servent_data data;
|
||||
(void) getservbyname_r(name, proto, se, &data);
|
||||
|
||||
],ac_cv_func_which_getservbyname_r=four,
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
# include <netdb.h>
|
||||
], [
|
||||
char *name;
|
||||
char *proto;
|
||||
struct servent *se, *res;
|
||||
char buffer[2048];
|
||||
int buflen = 2048;
|
||||
(void) getservbyname_r(name, proto, se, buffer, buflen, &res)
|
||||
],ac_cv_func_which_getservbyname_r=six,
|
||||
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
# include <netdb.h>
|
||||
], [
|
||||
char *name;
|
||||
char *proto;
|
||||
struct servent *se;
|
||||
char buffer[2048];
|
||||
int buflen = 2048;
|
||||
(void) getservbyname_r(name, proto, se, buffer, buflen)
|
||||
],ac_cv_func_which_getservbyname_r=five,ac_cv_func_which_getservbyname_r=no)
|
||||
|
||||
]
|
||||
|
||||
)
|
||||
]
|
||||
)]
|
||||
,ac_cv_func_which_getservbyname_r=no)])
|
||||
|
||||
if test $ac_cv_func_which_getservbyname_r = six; then
|
||||
AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_6)
|
||||
elif test $ac_cv_func_which_getservbyname_r = five; then
|
||||
AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_5)
|
||||
elif test $ac_cv_func_which_getservbyname_r = four; then
|
||||
AC_DEFINE(HAVE_FUNC_GETSERVBYNAME_R_4)
|
||||
|
||||
fi
|
||||
|
||||
])
|
155
build/aclocal/ax_func_which_gethostbyname_r.m4
Normal file
155
build/aclocal/ax_func_which_gethostbyname_r.m4
Normal file
@@ -0,0 +1,155 @@
|
||||
dnl @synopsis AX_FUNC_WHICH_GETHOSTBYNAME_R
|
||||
dnl
|
||||
dnl Determines which historical variant of the gethostbyname_r() call
|
||||
dnl (taking three, five, or six arguments) is available on the system
|
||||
dnl and defines one of the following macros accordingly:
|
||||
dnl
|
||||
dnl HAVE_FUNC_GETHOSTBYNAME_R_6
|
||||
dnl HAVE_FUNC_GETHOSTBYNAME_R_5
|
||||
dnl HAVE_FUNC_GETHOSTBYNAME_R_3
|
||||
dnl
|
||||
dnl If used in conjunction with gethostname.c, the API demonstrated in
|
||||
dnl test.c can be used regardless of which gethostbyname_r() is
|
||||
dnl available. These example files can be found at
|
||||
dnl http://www.csn.ul.ie/~caolan/publink/gethostbyname_r
|
||||
dnl
|
||||
dnl based on David Arnold's autoconf suggestion in the threads faq
|
||||
dnl
|
||||
dnl Originally named "AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R". Rewritten
|
||||
dnl for Autoconf 2.5x by Daniel Richard G.
|
||||
dnl
|
||||
dnl @category InstalledPackages
|
||||
dnl @author Caolan McNamara <caolan@skynet.ie>
|
||||
dnl @author Daniel Richard G. <skunk@iskunk.org>
|
||||
dnl @version 2005-01-21
|
||||
dnl @license GPLWithACException
|
||||
|
||||
AC_DEFUN([AX_FUNC_WHICH_GETHOSTBYNAME_R], [
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
AC_MSG_CHECKING([how many arguments gethostbyname_r() takes])
|
||||
|
||||
AC_CACHE_VAL(ac_cv_func_which_gethostbyname_r, [
|
||||
|
||||
################################################################
|
||||
|
||||
ac_cv_func_which_gethostbyname_r=unknown
|
||||
|
||||
#
|
||||
# ONE ARGUMENT (sanity check)
|
||||
#
|
||||
|
||||
# This should fail, as there is no variant of gethostbyname_r() that takes
|
||||
# a single argument. If it actually compiles, then we can assume that
|
||||
# netdb.h is not declaring the function, and the compiler is thereby
|
||||
# assuming an implicit prototype. In which case, we're out of luck.
|
||||
#
|
||||
AC_COMPILE_IFELSE(
|
||||
AC_LANG_PROGRAM(
|
||||
[[#include <netdb.h>]],
|
||||
[[
|
||||
char *name = "www.gnu.org";
|
||||
(void)gethostbyname_r(name) /* ; */
|
||||
]]),
|
||||
ac_cv_func_which_gethostbyname_r=no)
|
||||
|
||||
#
|
||||
# SIX ARGUMENTS
|
||||
# (e.g. Linux)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
AC_LANG_PROGRAM(
|
||||
[[#include <netdb.h>]],
|
||||
[[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret, *retp;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &retp, &my_h_errno) /* ; */
|
||||
]]),
|
||||
ac_cv_func_which_gethostbyname_r=six)
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# FIVE ARGUMENTS
|
||||
# (e.g. Solaris)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
AC_LANG_PROGRAM(
|
||||
[[#include <netdb.h>]],
|
||||
[[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
char buf@<:@1024@:>@;
|
||||
int buflen = 1024;
|
||||
int my_h_errno;
|
||||
(void)gethostbyname_r(name, &ret, buf, buflen, &my_h_errno) /* ; */
|
||||
]]),
|
||||
ac_cv_func_which_gethostbyname_r=five)
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
# THREE ARGUMENTS
|
||||
# (e.g. AIX, HP-UX, Tru64)
|
||||
#
|
||||
|
||||
if test "$ac_cv_func_which_gethostbyname_r" = "unknown"; then
|
||||
|
||||
AC_COMPILE_IFELSE(
|
||||
AC_LANG_PROGRAM(
|
||||
[[#include <netdb.h>]],
|
||||
[[
|
||||
char *name = "www.gnu.org";
|
||||
struct hostent ret;
|
||||
struct hostent_data data;
|
||||
(void)gethostbyname_r(name, &ret, &data) /* ; */
|
||||
]]),
|
||||
ac_cv_func_which_gethostbyname_r=three)
|
||||
|
||||
fi
|
||||
|
||||
################################################################
|
||||
|
||||
]) dnl end AC_CACHE_VAL
|
||||
|
||||
case "$ac_cv_func_which_gethostbyname_r" in
|
||||
three)
|
||||
AC_MSG_RESULT([three])
|
||||
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_3)
|
||||
;;
|
||||
|
||||
five)
|
||||
AC_MSG_RESULT([five])
|
||||
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_5)
|
||||
;;
|
||||
|
||||
six)
|
||||
AC_MSG_RESULT([six])
|
||||
AC_DEFINE(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
||||
;;
|
||||
|
||||
no)
|
||||
AC_MSG_RESULT([cannot find function declaration in netdb.h])
|
||||
;;
|
||||
|
||||
unknown)
|
||||
AC_MSG_RESULT([can't tell])
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([internal error])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_LANG_POP(C)
|
||||
|
||||
]) dnl end AC_DEFUN
|
@@ -1,90 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/scrolwin.h
|
||||
// Purpose: wxGenericScrolledWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_SCROLLWIN_H_
|
||||
#define _WX_GENERIC_SCROLLWIN_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers and constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
extern WXDLLEXPORT_DATA(const wxChar*) wxPanelNameStr;
|
||||
|
||||
// default scrolled window style
|
||||
#ifndef wxScrolledWindowStyle
|
||||
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericScrolledWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
wxGenericScrolledWindow() : wxScrollHelper(this) { }
|
||||
wxGenericScrolledWindow(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, winid, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericScrolledWindow();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
virtual void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
|
||||
|
||||
// lay out the window and its children
|
||||
virtual bool Layout();
|
||||
|
||||
virtual void DoSetVirtualSize(int x, int y);
|
||||
|
||||
// wxWindow's GetBestVirtualSize returns the actual window size,
|
||||
// whereas we want to return the virtual size
|
||||
virtual wxSize GetBestVirtualSize() const;
|
||||
|
||||
// Return the size best suited for the current window
|
||||
// (this isn't a virtual size, this is a sensible size for the window)
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
protected:
|
||||
// this is needed for wxEVT_PAINT processing hack described in
|
||||
// wxScrollHelperEvtHandler::ProcessEvent()
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// we need to return a special WM_GETDLGCODE value to process just the
|
||||
// arrows but let the other navigation characters through
|
||||
#ifdef __WXMSW__
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
#endif // __WXMSW__
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericScrolledWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_SCROLLWIN_H_
|
||||
|
@@ -1,193 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/scrolwin.h
|
||||
// Purpose: wxScrolledWindow class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_SCROLLWIN_H_
|
||||
#define _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers and constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
|
||||
|
||||
// default scrolled window style
|
||||
#ifndef wxScrolledWindowStyle
|
||||
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrolledWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxScrolledWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
wxScrolledWindow()
|
||||
{ Init(); }
|
||||
|
||||
wxScrolledWindow(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{ Create(parent, id, pos, size, style, name); }
|
||||
|
||||
void Init();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Normally the wxScrolledWindow will scroll itself, but in
|
||||
// some rare occasions you might want it to scroll another
|
||||
// window (e.g. a child of it in order to scroll only a portion
|
||||
// the area between the scrollbars (spreadsheet: only cell area
|
||||
// will move).
|
||||
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
|
||||
virtual wxWindow *GetTargetWindow() const;
|
||||
|
||||
// Set the scrolled area of the window.
|
||||
virtual void DoSetVirtualSize( int x, int y );
|
||||
|
||||
// wxWindow's GetBestVirtualSize returns the actual window size,
|
||||
// whereas we want to return the virtual size
|
||||
virtual wxSize GetBestVirtualSize() const;
|
||||
|
||||
// Return the size best suited for the current window
|
||||
// (this isn't a virtual size, this is a sensible size for the window)
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// Set the x, y scrolling increments.
|
||||
void SetScrollRate( int xstep, int ystep );
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
// Default action is to set the virtual size and alter scrollbars
|
||||
// accordingly.
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = FALSE );
|
||||
|
||||
// Physically scroll the window
|
||||
virtual void Scroll(int x_pos, int y_pos);
|
||||
|
||||
int GetScrollPageSize(int orient) const;
|
||||
void SetScrollPageSize(int orient, int pageSize);
|
||||
|
||||
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
|
||||
|
||||
// Enable/disable Windows scrolling in either direction.
|
||||
// If TRUE, wxWidgets scrolls the canvas and only a bit of
|
||||
// the canvas is invalidated; no Clear() is necessary.
|
||||
// If FALSE, the whole canvas is invalidated and a Clear() is
|
||||
// necessary. Disable for when the scroll increment is used
|
||||
// to actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
|
||||
|
||||
// Get the view start
|
||||
virtual void GetViewStart(int *x, int *y) const;
|
||||
|
||||
// translate between scrolled and unscrolled coordinates
|
||||
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
|
||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
||||
|
||||
// Override this function if you don't want to have wxScrolledWindow
|
||||
// automatically change the origin according to the scroll position.
|
||||
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
|
||||
|
||||
// lay out the window and its children
|
||||
virtual bool Layout();
|
||||
|
||||
// Adjust the scrollbars
|
||||
virtual void AdjustScrollbars();
|
||||
|
||||
// Set the scale factor, used in PrepareDC
|
||||
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
|
||||
double GetScaleX() const { return m_scaleX; }
|
||||
double GetScaleY() const { return m_scaleY; }
|
||||
|
||||
// implementation from now on
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
||||
void GtkVScroll( float value, unsigned int scroll_type );
|
||||
void GtkHScroll( float value, unsigned int scroll_type );
|
||||
void GtkVConnectEvent();
|
||||
void GtkHConnectEvent();
|
||||
void GtkVDisconnectEvent();
|
||||
void GtkHDisconnectEvent();
|
||||
|
||||
// Calculate scroll increment
|
||||
virtual int CalcScrollInc(wxScrollWinEvent& event);
|
||||
|
||||
// Overridden from wxWidgets due callback being static
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
|
||||
virtual void DoPrepareDC(wxDC& dc);
|
||||
|
||||
protected:
|
||||
wxWindow *m_targetWindow;
|
||||
int m_xScrollPixelsPerLine;
|
||||
int m_yScrollPixelsPerLine;
|
||||
bool m_xScrollingEnabled;
|
||||
bool m_yScrollingEnabled;
|
||||
|
||||
// FIXME: these next four members are duplicated in the GtkAdjustment
|
||||
// members of wxWindow. Can they be safely removed from here?
|
||||
|
||||
int m_xScrollPosition;
|
||||
int m_yScrollPosition;
|
||||
int m_xScrollLinesPerPage;
|
||||
int m_yScrollLinesPerPage;
|
||||
|
||||
double m_scaleY,m_scaleX;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
// vi:sts=4:sw=4:et
|
@@ -1,300 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/window.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKWINDOWH__
|
||||
#define __GTKWINDOWH__
|
||||
|
||||
// helper structure that holds class that holds GtkIMContext object and
|
||||
// some additional data needed for key events processing
|
||||
struct wxGtkIMData;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback definition for inserting a window (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowGTK;
|
||||
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
|
||||
{
|
||||
public:
|
||||
// creating the window
|
||||
// -------------------
|
||||
wxWindowGTK();
|
||||
wxWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxWindowGTK();
|
||||
|
||||
// implement base class (pure) virtual methods
|
||||
// -------------------------------------------
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
virtual bool IsRetained() const;
|
||||
|
||||
virtual void SetFocus();
|
||||
virtual bool AcceptsFocus() const;
|
||||
|
||||
virtual bool Reparent( wxWindowBase *newParent );
|
||||
|
||||
virtual void WarpPointer(int x, int y);
|
||||
|
||||
virtual void Refresh( bool eraseBackground = TRUE,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
virtual void Update();
|
||||
virtual void ClearBackground();
|
||||
|
||||
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||
virtual bool SetForegroundColour( const wxColour &colour );
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
|
||||
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
virtual void GetTextExtent(const wxString& string,
|
||||
int *x, int *y,
|
||||
int *descent = (int *) NULL,
|
||||
int *externalLeading = (int *) NULL,
|
||||
const wxFont *theFont = (const wxFont *) NULL)
|
||||
const;
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
virtual void ScrollWindow( int dx, int dy,
|
||||
const wxRect* rect = (wxRect *) NULL );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
virtual void AddChild( wxWindowBase *child );
|
||||
virtual void RemoveChild( wxWindowBase *child );
|
||||
#endif
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
virtual WXWidget GetHandle() const { return m_widget; }
|
||||
|
||||
// I don't want users to override what's done in idle so everything that
|
||||
// has to be done in idle time in order for wxGTK to work is done in
|
||||
// OnInternalIdle
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
// Internal represention of Update()
|
||||
void GtkUpdate();
|
||||
|
||||
// For compatibility across platforms (not in event table)
|
||||
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
// to give widgets an oppprtunity to correct their colours after they
|
||||
// have been changed by Enable
|
||||
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
|
||||
|
||||
// Used by all window classes in the widget creation process.
|
||||
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
|
||||
void PostCreation();
|
||||
|
||||
// Internal addition of child windows. differs from class
|
||||
// to class not by using virtual functions but by using
|
||||
// the m_insertCallback.
|
||||
void DoAddChild(wxWindowGTK *child);
|
||||
|
||||
// This methods sends wxPaintEvents to the window. It reads the
|
||||
// update region, breaks it up into rects and sends an event
|
||||
// for each rect. It is also responsible for background erase
|
||||
// events and NC paint events. It is called from "draw" and
|
||||
// "expose" handlers as well as from ::Update()
|
||||
void GtkSendPaintEvents();
|
||||
|
||||
// The methods below are required because many native widgets
|
||||
// are composed of several subwidgets and setting a style for
|
||||
// the widget means setting it for all subwidgets as well.
|
||||
// also, it is nor clear, which native widget is the top
|
||||
// widget where (most of) the input goes. even tooltips have
|
||||
// to be applied to all subwidgets.
|
||||
virtual GtkWidget* GetConnectWidget();
|
||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ConnectWidget( GtkWidget *widget );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
// Returns the default context which usually is anti-aliased
|
||||
PangoContext *GtkGetPangoDefaultContext();
|
||||
|
||||
// Returns the X11 context which renders on the X11 client
|
||||
// side (which can be remote) and which usually is not
|
||||
// anti-aliased and is thus faster
|
||||
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
|
||||
// not depend on libpangox - which is completely deprecated.
|
||||
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
|
||||
PangoContext *GtkGetPangoX11Context();
|
||||
PangoContext *m_x11Context; // MR: Now unused
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// Called from GTK signales handlers. it indicates that
|
||||
// the layouting functions have to be called later on
|
||||
// (i.e. in idle time, implemented in OnInternalIdle() ).
|
||||
void GtkUpdateSize() { m_sizeSet = FALSE; }
|
||||
|
||||
// fix up the mouse event coords, used by wxListBox only so far
|
||||
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
||||
wxCoord& WXUNUSED(x),
|
||||
wxCoord& WXUNUSED(y)) { }
|
||||
|
||||
// is this window transparent for the mouse events (as wxStaticBox is)?
|
||||
virtual bool IsTransparentForMouse() const { return FALSE; }
|
||||
|
||||
// is this a radiobutton (used by radiobutton code itself only)?
|
||||
virtual bool IsRadioButton() const { return FALSE; }
|
||||
|
||||
// position and size of the window
|
||||
int m_x, m_y;
|
||||
int m_width, m_height;
|
||||
int m_oldClientWidth,m_oldClientHeight;
|
||||
|
||||
// see the docs in src/gtk/window.cpp
|
||||
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
|
||||
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
|
||||
|
||||
// this widget will be queried for GTK's focus events
|
||||
GtkWidget *m_focusWidget;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
wxGtkIMData *m_imData;
|
||||
#else // GTK 1
|
||||
#ifdef HAVE_XIM
|
||||
// XIM support for wxWidgets
|
||||
GdkIC *m_ic;
|
||||
GdkICAttr *m_icattr;
|
||||
#endif // HAVE_XIM
|
||||
#endif // GTK 2/1
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
// The area to be cleared (and not just refreshed)
|
||||
// We cannot make this distinction under GTK 2.0.
|
||||
wxRegion m_clearRegion;
|
||||
#endif
|
||||
|
||||
// scrolling stuff
|
||||
GtkAdjustment *m_hAdjust,*m_vAdjust;
|
||||
float m_oldHorizontalPos;
|
||||
float m_oldVerticalPos;
|
||||
|
||||
// extra (wxGTK-specific) flags
|
||||
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
|
||||
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
||||
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
||||
bool m_hasScrolling:1;
|
||||
bool m_hasVMT:1;
|
||||
bool m_sizeSet:1;
|
||||
bool m_resizing:1;
|
||||
bool m_acceptsFocus:1; // true if not static
|
||||
bool m_hasFocus:1; // true if == FindFocus()
|
||||
bool m_isScrolling:1; // dragging scrollbar thumb?
|
||||
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
|
||||
#ifdef __WXGTK20__
|
||||
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
|
||||
// chain needs update
|
||||
#endif
|
||||
bool m_needsStyleChange:1; // May not be able to change
|
||||
// background style until OnIdle
|
||||
|
||||
// C++ has no virtual methods in the constrcutor of any class but we need
|
||||
// different methods of inserting a child window into a wxFrame,
|
||||
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
|
||||
wxInsertChildFunction m_insertCallback;
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
virtual void DoCaptureMouse();
|
||||
virtual void DoReleaseMouse();
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip( wxToolTip *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
protected:
|
||||
// common part of all ctors (not virtual because called from ctor)
|
||||
void Init();
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
|
||||
|
||||
// Copies m_children tab order to GTK focus chain:
|
||||
void RealizeTabOrder();
|
||||
#endif
|
||||
|
||||
// Called by ApplyWidgetStyle (which is called by SetFont() and
|
||||
// SetXXXColour etc to apply style changed to native widgets) to create
|
||||
// modified GTK style with non-standard attributes. If forceStyle=true,
|
||||
// creates empty GtkRcStyle if there are no modifications, otherwise
|
||||
// returns NULL in such case.
|
||||
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// Overridden in many GTK widgets who have to handle subwidgets
|
||||
virtual void ApplyWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// helper function to ease native widgets wrapping, called by
|
||||
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowGTK)
|
||||
};
|
||||
|
||||
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
|
||||
|
||||
#endif // __GTKWINDOWH__
|
@@ -1,193 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/scrolwin.h
|
||||
// Purpose: wxScrolledWindow class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_SCROLLWIN_H_
|
||||
#define _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers and constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
|
||||
|
||||
// default scrolled window style
|
||||
#ifndef wxScrolledWindowStyle
|
||||
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrolledWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxScrolledWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
wxScrolledWindow()
|
||||
{ Init(); }
|
||||
|
||||
wxScrolledWindow(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{ Create(parent, id, pos, size, style, name); }
|
||||
|
||||
void Init();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Normally the wxScrolledWindow will scroll itself, but in
|
||||
// some rare occasions you might want it to scroll another
|
||||
// window (e.g. a child of it in order to scroll only a portion
|
||||
// the area between the scrollbars (spreadsheet: only cell area
|
||||
// will move).
|
||||
virtual void SetTargetWindow( wxWindow *target, bool pushEventHandler = FALSE );
|
||||
virtual wxWindow *GetTargetWindow() const;
|
||||
|
||||
// Set the scrolled area of the window.
|
||||
virtual void DoSetVirtualSize( int x, int y );
|
||||
|
||||
// wxWindow's GetBestVirtualSize returns the actual window size,
|
||||
// whereas we want to return the virtual size
|
||||
virtual wxSize GetBestVirtualSize() const;
|
||||
|
||||
// Return the size best suited for the current window
|
||||
// (this isn't a virtual size, this is a sensible size for the window)
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// Set the x, y scrolling increments.
|
||||
void SetScrollRate( int xstep, int ystep );
|
||||
|
||||
// Number of pixels per user unit (0 or -1 for no scrollbar)
|
||||
// Length of virtual canvas in user units
|
||||
// Length of page in user units
|
||||
// Default action is to set the virtual size and alter scrollbars
|
||||
// accordingly.
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = FALSE );
|
||||
|
||||
// Physically scroll the window
|
||||
virtual void Scroll(int x_pos, int y_pos);
|
||||
|
||||
int GetScrollPageSize(int orient) const;
|
||||
void SetScrollPageSize(int orient, int pageSize);
|
||||
|
||||
virtual void GetScrollPixelsPerUnit(int *x_unit, int *y_unit) const;
|
||||
|
||||
// Enable/disable Windows scrolling in either direction.
|
||||
// If TRUE, wxWidgets scrolls the canvas and only a bit of
|
||||
// the canvas is invalidated; no Clear() is necessary.
|
||||
// If FALSE, the whole canvas is invalidated and a Clear() is
|
||||
// necessary. Disable for when the scroll increment is used
|
||||
// to actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
|
||||
|
||||
// Get the view start
|
||||
virtual void GetViewStart(int *x, int *y) const;
|
||||
|
||||
// translate between scrolled and unscrolled coordinates
|
||||
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
|
||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
||||
|
||||
// Override this function if you don't want to have wxScrolledWindow
|
||||
// automatically change the origin according to the scroll position.
|
||||
void PrepareDC(wxDC& dc) { DoPrepareDC(dc); }
|
||||
|
||||
// lay out the window and its children
|
||||
virtual bool Layout();
|
||||
|
||||
// Adjust the scrollbars
|
||||
virtual void AdjustScrollbars();
|
||||
|
||||
// Set the scale factor, used in PrepareDC
|
||||
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
|
||||
double GetScaleX() const { return m_scaleX; }
|
||||
double GetScaleY() const { return m_scaleY; }
|
||||
|
||||
// implementation from now on
|
||||
void OnScroll(wxScrollWinEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
||||
void GtkVScroll( float value, unsigned int scroll_type );
|
||||
void GtkHScroll( float value, unsigned int scroll_type );
|
||||
void GtkVConnectEvent();
|
||||
void GtkHConnectEvent();
|
||||
void GtkVDisconnectEvent();
|
||||
void GtkHDisconnectEvent();
|
||||
|
||||
// Calculate scroll increment
|
||||
virtual int CalcScrollInc(wxScrollWinEvent& event);
|
||||
|
||||
// Overridden from wxWidgets due callback being static
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
|
||||
virtual void DoPrepareDC(wxDC& dc);
|
||||
|
||||
protected:
|
||||
wxWindow *m_targetWindow;
|
||||
int m_xScrollPixelsPerLine;
|
||||
int m_yScrollPixelsPerLine;
|
||||
bool m_xScrollingEnabled;
|
||||
bool m_yScrollingEnabled;
|
||||
|
||||
// FIXME: these next four members are duplicated in the GtkAdjustment
|
||||
// members of wxWindow. Can they be safely removed from here?
|
||||
|
||||
int m_xScrollPosition;
|
||||
int m_yScrollPosition;
|
||||
int m_xScrollLinesPerPage;
|
||||
int m_yScrollLinesPerPage;
|
||||
|
||||
double m_scaleY,m_scaleX;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxScrolledWindow)
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_GTK_SCROLLWIN_H_
|
||||
|
||||
// vi:sts=4:sw=4:et
|
@@ -1,300 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/window.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id$
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GTKWINDOWH__
|
||||
#define __GTKWINDOWH__
|
||||
|
||||
// helper structure that holds class that holds GtkIMContext object and
|
||||
// some additional data needed for key events processing
|
||||
struct wxGtkIMData;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback definition for inserting a window (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowGTK;
|
||||
typedef void (*wxInsertChildFunction)( wxWindowGTK*, wxWindowGTK* );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWindowGTK : public wxWindowBase
|
||||
{
|
||||
public:
|
||||
// creating the window
|
||||
// -------------------
|
||||
wxWindowGTK();
|
||||
wxWindowGTK(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxWindowGTK();
|
||||
|
||||
// implement base class (pure) virtual methods
|
||||
// -------------------------------------------
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
|
||||
virtual bool IsRetained() const;
|
||||
|
||||
virtual void SetFocus();
|
||||
virtual bool AcceptsFocus() const;
|
||||
|
||||
virtual bool Reparent( wxWindowBase *newParent );
|
||||
|
||||
virtual void WarpPointer(int x, int y);
|
||||
|
||||
virtual void Refresh( bool eraseBackground = TRUE,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
virtual void Update();
|
||||
virtual void ClearBackground();
|
||||
|
||||
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||
virtual bool SetForegroundColour( const wxColour &colour );
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style) ;
|
||||
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
virtual void GetTextExtent(const wxString& string,
|
||||
int *x, int *y,
|
||||
int *descent = (int *) NULL,
|
||||
int *externalLeading = (int *) NULL,
|
||||
const wxFont *theFont = (const wxFont *) NULL)
|
||||
const;
|
||||
|
||||
#if wxUSE_MENUS_NATIVE
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
#endif // wxUSE_MENUS_NATIVE
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
virtual void ScrollWindow( int dx, int dy,
|
||||
const wxRect* rect = (wxRect *) NULL );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
virtual void AddChild( wxWindowBase *child );
|
||||
virtual void RemoveChild( wxWindowBase *child );
|
||||
#endif
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
virtual WXWidget GetHandle() const { return m_widget; }
|
||||
|
||||
// I don't want users to override what's done in idle so everything that
|
||||
// has to be done in idle time in order for wxGTK to work is done in
|
||||
// OnInternalIdle
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
// Internal represention of Update()
|
||||
void GtkUpdate();
|
||||
|
||||
// For compatibility across platforms (not in event table)
|
||||
void OnIdle(wxIdleEvent& WXUNUSED(event)) {}
|
||||
|
||||
// wxGTK-specific: called recursively by Enable,
|
||||
// to give widgets an oppprtunity to correct their colours after they
|
||||
// have been changed by Enable
|
||||
virtual void OnParentEnable( bool WXUNUSED(enable) ) {}
|
||||
|
||||
// Used by all window classes in the widget creation process.
|
||||
bool PreCreation( wxWindowGTK *parent, const wxPoint &pos, const wxSize &size );
|
||||
void PostCreation();
|
||||
|
||||
// Internal addition of child windows. differs from class
|
||||
// to class not by using virtual functions but by using
|
||||
// the m_insertCallback.
|
||||
void DoAddChild(wxWindowGTK *child);
|
||||
|
||||
// This methods sends wxPaintEvents to the window. It reads the
|
||||
// update region, breaks it up into rects and sends an event
|
||||
// for each rect. It is also responsible for background erase
|
||||
// events and NC paint events. It is called from "draw" and
|
||||
// "expose" handlers as well as from ::Update()
|
||||
void GtkSendPaintEvents();
|
||||
|
||||
// The methods below are required because many native widgets
|
||||
// are composed of several subwidgets and setting a style for
|
||||
// the widget means setting it for all subwidgets as well.
|
||||
// also, it is nor clear, which native widget is the top
|
||||
// widget where (most of) the input goes. even tooltips have
|
||||
// to be applied to all subwidgets.
|
||||
virtual GtkWidget* GetConnectWidget();
|
||||
virtual bool IsOwnGtkWindow( GdkWindow *window );
|
||||
void ConnectWidget( GtkWidget *widget );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
// Returns the default context which usually is anti-aliased
|
||||
PangoContext *GtkGetPangoDefaultContext();
|
||||
|
||||
// Returns the X11 context which renders on the X11 client
|
||||
// side (which can be remote) and which usually is not
|
||||
// anti-aliased and is thus faster
|
||||
// MR: Now returns the default pango_context for the widget as GtkGetPangoDefaultContext to
|
||||
// not depend on libpangox - which is completely deprecated.
|
||||
//BCI: Remove GtkGetPangoX11Context and m_x11Context completely when symbols may be removed
|
||||
PangoContext *GtkGetPangoX11Context();
|
||||
PangoContext *m_x11Context; // MR: Now unused
|
||||
#endif
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// Called from GTK signales handlers. it indicates that
|
||||
// the layouting functions have to be called later on
|
||||
// (i.e. in idle time, implemented in OnInternalIdle() ).
|
||||
void GtkUpdateSize() { m_sizeSet = FALSE; }
|
||||
|
||||
// fix up the mouse event coords, used by wxListBox only so far
|
||||
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
||||
wxCoord& WXUNUSED(x),
|
||||
wxCoord& WXUNUSED(y)) { }
|
||||
|
||||
// is this window transparent for the mouse events (as wxStaticBox is)?
|
||||
virtual bool IsTransparentForMouse() const { return FALSE; }
|
||||
|
||||
// is this a radiobutton (used by radiobutton code itself only)?
|
||||
virtual bool IsRadioButton() const { return FALSE; }
|
||||
|
||||
// position and size of the window
|
||||
int m_x, m_y;
|
||||
int m_width, m_height;
|
||||
int m_oldClientWidth,m_oldClientHeight;
|
||||
|
||||
// see the docs in src/gtk/window.cpp
|
||||
GtkWidget *m_widget; // mostly the widget seen by the rest of GTK
|
||||
GtkWidget *m_wxwindow; // mostly the client area as per wxWidgets
|
||||
|
||||
// this widget will be queried for GTK's focus events
|
||||
GtkWidget *m_focusWidget;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
wxGtkIMData *m_imData;
|
||||
#else // GTK 1
|
||||
#ifdef HAVE_XIM
|
||||
// XIM support for wxWidgets
|
||||
GdkIC *m_ic;
|
||||
GdkICAttr *m_icattr;
|
||||
#endif // HAVE_XIM
|
||||
#endif // GTK 2/1
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
// The area to be cleared (and not just refreshed)
|
||||
// We cannot make this distinction under GTK 2.0.
|
||||
wxRegion m_clearRegion;
|
||||
#endif
|
||||
|
||||
// scrolling stuff
|
||||
GtkAdjustment *m_hAdjust,*m_vAdjust;
|
||||
float m_oldHorizontalPos;
|
||||
float m_oldVerticalPos;
|
||||
|
||||
// extra (wxGTK-specific) flags
|
||||
bool m_needParent:1; // ! wxFrame, wxDialog, wxNotebookPage ?
|
||||
bool m_noExpose:1; // wxGLCanvas has its own redrawing
|
||||
bool m_nativeSizeEvent:1; // wxGLCanvas sends wxSizeEvent upon "alloc_size"
|
||||
bool m_hasScrolling:1;
|
||||
bool m_hasVMT:1;
|
||||
bool m_sizeSet:1;
|
||||
bool m_resizing:1;
|
||||
bool m_acceptsFocus:1; // true if not static
|
||||
bool m_hasFocus:1; // true if == FindFocus()
|
||||
bool m_isScrolling:1; // dragging scrollbar thumb?
|
||||
bool m_clipPaintRegion:1; // TRUE after ScrollWindow()
|
||||
#ifdef __WXGTK20__
|
||||
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
|
||||
// chain needs update
|
||||
#endif
|
||||
bool m_needsStyleChange:1; // May not be able to change
|
||||
// background style until OnIdle
|
||||
|
||||
// C++ has no virtual methods in the constrcutor of any class but we need
|
||||
// different methods of inserting a child window into a wxFrame,
|
||||
// wxMDIFrame, wxNotebook etc. this is the callback that will get used.
|
||||
wxInsertChildFunction m_insertCallback;
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
virtual void DoGetSize( int *width, int *height ) const;
|
||||
virtual void DoGetClientSize( int *width, int *height ) const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
virtual void DoCaptureMouse();
|
||||
virtual void DoReleaseMouse();
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip( wxToolTip *tip );
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
protected:
|
||||
// common part of all ctors (not virtual because called from ctor)
|
||||
void Init();
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
virtual void DoMoveInTabOrder(wxWindow *win, MoveKind move);
|
||||
|
||||
// Copies m_children tab order to GTK focus chain:
|
||||
void RealizeTabOrder();
|
||||
#endif
|
||||
|
||||
// Called by ApplyWidgetStyle (which is called by SetFont() and
|
||||
// SetXXXColour etc to apply style changed to native widgets) to create
|
||||
// modified GTK style with non-standard attributes. If forceStyle=true,
|
||||
// creates empty GtkRcStyle if there are no modifications, otherwise
|
||||
// returns NULL in such case.
|
||||
GtkRcStyle *CreateWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// Overridden in many GTK widgets who have to handle subwidgets
|
||||
virtual void ApplyWidgetStyle(bool forceStyle = false);
|
||||
|
||||
// helper function to ease native widgets wrapping, called by
|
||||
// ApplyWidgetStyle -- override this, not ApplyWidgetStyle
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowGTK)
|
||||
DECLARE_NO_COPY_CLASS(wxWindowGTK)
|
||||
};
|
||||
|
||||
extern WXDLLIMPEXP_CORE wxWindow *wxFindFocusedChild(wxWindowGTK *win);
|
||||
|
||||
#endif // __GTKWINDOWH__
|
@@ -1,238 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: include/wx/scrolwin.h
|
||||
// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 30.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SCROLWIN_H_BASE_
|
||||
#define _WX_SCROLWIN_H_BASE_
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
class WXDLLEXPORT wxScrollHelperEvtHandler;
|
||||
class WXDLLEXPORT wxTimer;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrollHelper: this class implements the scrolling logic which is used by
|
||||
// wxScrolledWindow and wxScrolledControl. It is a mix-in: just derive from it
|
||||
// to implement scrolling in your class.
|
||||
// ----------------------------------------------------------------------------
|
||||
#if !defined(__WXGTK__) || defined(__WXUNIVERSAL__)
|
||||
|
||||
class WXDLLEXPORT wxScrollHelper
|
||||
{
|
||||
public:
|
||||
// ctor and dtor
|
||||
wxScrollHelper(wxWindow *winToScroll = (wxWindow *)NULL);
|
||||
void SetWindow(wxWindow *winToScroll);
|
||||
virtual ~wxScrollHelper();
|
||||
|
||||
// configure the scrolling
|
||||
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
||||
int noUnitsX, int noUnitsY,
|
||||
int xPos = 0, int yPos = 0,
|
||||
bool noRefresh = false );
|
||||
|
||||
// scroll to the given (in logical coords) position
|
||||
virtual void Scroll(int x, int y);
|
||||
|
||||
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
|
||||
int GetScrollPageSize(int orient) const;
|
||||
void SetScrollPageSize(int orient, int pageSize);
|
||||
|
||||
// Set the x, y scrolling increments.
|
||||
void SetScrollRate( int xstep, int ystep );
|
||||
|
||||
// get the size of one logical unit in physical ones
|
||||
virtual void GetScrollPixelsPerUnit(int *pixelsPerUnitX,
|
||||
int *pixelsPerUnitY) const;
|
||||
|
||||
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
|
||||
// scrolls the canvas and only a bit of the canvas is invalidated; no
|
||||
// Clear() is necessary. If false, the whole canvas is invalidated and a
|
||||
// Clear() is necessary. Disable for when the scroll increment is used to
|
||||
// actually scroll a non-constant distance
|
||||
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
|
||||
|
||||
// Get the view start
|
||||
virtual void GetViewStart(int *x, int *y) const;
|
||||
|
||||
// Set the scale factor, used in PrepareDC
|
||||
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
|
||||
double GetScaleX() const { return m_scaleX; }
|
||||
double GetScaleY() const { return m_scaleY; }
|
||||
|
||||
// translate between scrolled and unscrolled coordinates
|
||||
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||
{
|
||||
wxPoint p2;
|
||||
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||
return p2;
|
||||
}
|
||||
|
||||
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||
|
||||
// Adjust the scrollbars
|
||||
virtual void AdjustScrollbars(void);
|
||||
|
||||
// Calculate scroll increment
|
||||
virtual int CalcScrollInc(wxScrollWinEvent& event);
|
||||
|
||||
// Normally the wxScrolledWindow will scroll itself, but in some rare
|
||||
// occasions you might want it to scroll [part of] another window (e.g. a
|
||||
// child of it in order to scroll only a portion the area between the
|
||||
// scrollbars (spreadsheet: only cell area will move).
|
||||
virtual void SetTargetWindow(wxWindow *target);
|
||||
virtual wxWindow *GetTargetWindow() const;
|
||||
|
||||
void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; }
|
||||
wxRect GetTargetRect() const { return m_rectToScroll; }
|
||||
|
||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
|
||||
|
||||
// change the DC origin according to the scroll position.
|
||||
virtual void DoPrepareDC(wxDC& dc);
|
||||
|
||||
// are we generating the autoscroll events?
|
||||
bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; }
|
||||
|
||||
// stop generating the scroll events when mouse is held outside the window
|
||||
void StopAutoScrolling();
|
||||
|
||||
// this method can be overridden in a derived class to forbid sending the
|
||||
// auto scroll events - note that unlike StopAutoScrolling() it doesn't
|
||||
// stop the timer, so it will be called repeatedly and will typically
|
||||
// return different values depending on the current mouse position
|
||||
//
|
||||
// the base class version just returns true
|
||||
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
|
||||
|
||||
// the methods to be called from the window event handlers
|
||||
void HandleOnScroll(wxScrollWinEvent& event);
|
||||
void HandleOnSize(wxSizeEvent& event);
|
||||
void HandleOnPaint(wxPaintEvent& event);
|
||||
void HandleOnChar(wxKeyEvent& event);
|
||||
void HandleOnMouseEnter(wxMouseEvent& event);
|
||||
void HandleOnMouseLeave(wxMouseEvent& event);
|
||||
#if wxUSE_MOUSEWHEEL
|
||||
void HandleOnMouseWheel(wxMouseEvent& event);
|
||||
#endif // wxUSE_MOUSEWHEEL
|
||||
|
||||
// FIXME: this is needed for now for wxPlot compilation, should be removed
|
||||
// once it is fixed!
|
||||
void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); }
|
||||
|
||||
protected:
|
||||
// get pointer to our scroll rect if we use it or NULL
|
||||
const wxRect *GetScrollRect() const
|
||||
{
|
||||
return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL;
|
||||
}
|
||||
|
||||
// get the size of the target window
|
||||
wxSize GetTargetSize() const
|
||||
{
|
||||
return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize()
|
||||
: m_targetWindow->GetClientSize();
|
||||
}
|
||||
|
||||
void GetTargetSize(int *w, int *h)
|
||||
{
|
||||
wxSize size = GetTargetSize();
|
||||
if ( w )
|
||||
*w = size.x;
|
||||
if ( h )
|
||||
*h = size.y;
|
||||
}
|
||||
|
||||
// change just the target window (unlike SetWindow which changes m_win as
|
||||
// well)
|
||||
void DoSetTargetWindow(wxWindow *target);
|
||||
|
||||
// delete the event handler we installed
|
||||
void DeleteEvtHandler();
|
||||
|
||||
double m_scaleX;
|
||||
double m_scaleY;
|
||||
|
||||
wxWindow *m_win,
|
||||
*m_targetWindow;
|
||||
|
||||
wxRect m_rectToScroll;
|
||||
|
||||
wxTimer *m_timerAutoScroll;
|
||||
|
||||
int m_xScrollPixelsPerLine;
|
||||
int m_yScrollPixelsPerLine;
|
||||
int m_xScrollPosition;
|
||||
int m_yScrollPosition;
|
||||
int m_xScrollLines;
|
||||
int m_yScrollLines;
|
||||
int m_xScrollLinesPerPage;
|
||||
int m_yScrollLinesPerPage;
|
||||
|
||||
bool m_xScrollingEnabled;
|
||||
bool m_yScrollingEnabled;
|
||||
|
||||
#if wxUSE_MOUSEWHEEL
|
||||
int m_wheelRotation;
|
||||
#endif // wxUSE_MOUSEWHEEL
|
||||
|
||||
wxScrollHelperEvtHandler *m_handler;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxScrollHelper)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrolledWindow: a wxWindow which knows how to scroll
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
|
||||
#include "wx/gtk/scrolwin.h"
|
||||
#else // !wxGTK
|
||||
#include "wx/generic/scrolwin.h"
|
||||
|
||||
class WXDLLEXPORT wxScrolledWindow : public wxGenericScrolledWindow
|
||||
{
|
||||
public:
|
||||
wxScrolledWindow() { }
|
||||
wxScrolledWindow(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxScrolledWindowStyle,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
: wxGenericScrolledWindow(parent, winid, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow)
|
||||
};
|
||||
|
||||
#define wxSCROLLED_WINDOW_IS_GENERIC 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_SCROLWIN_H_BASE_
|
||||
|
1533
include/wx/window.h
1533
include/wx/window.h
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1044
src/gtk/scrolwin.cpp
1044
src/gtk/scrolwin.cpp
File diff suppressed because it is too large
Load Diff
4904
src/gtk/window.cpp
4904
src/gtk/window.cpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4904
src/gtk1/window.cpp
4904
src/gtk1/window.cpp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user