Hi Everybody,
I haven't checked this into CVS becuase of that stale lockfile, but I will
as soon as I can... This is all stuff I wrote for fun in a small hack
session tonight after not getting much done on textbox, and having a chat
with Lalo :) In the interest of making popup widgets and widgets in
general better, paving the way to more complex widgets, I made the
following changes:
- There are no more widgets marked "pgserver internal use only", it's
now safe to create any widget on the client side. Some of them have
weird results though:
+ http://picogui.org/download/background_widget.jpeg
This is a button widget, surrounded on all four sides by
background widgets. Since the background widget always draws
relative to the display origin, the panels appear to be completely
transparent when you resize them :)
- There's no longer any special voodoo involved in creating popup
widgets. Popups can now be created using the createwidget request,
and their position and size can be changed using PW_WP_ABSOLUTEX,
PG_WP_ABSOLUTEY, PG_WP_WIDTH, and PG_WP_HEIGHT properties. I modified
cli_c to retain source compatibility, but this does break binary
compatibility between revisions 19 and 20. It is planned to ditch the
pgNewPopup-style functions completely when we move to cli_c2, in favor
of a purely widget-based interface to standard dialogs.
- I implemented proper subclassing of widgets in pgserver. You can have
a new widget inherit from an existing one, with private data members
from both widget classes coexisting. This broke source compatibility
for widgets. To update a widget to the new method:
+ Replace your widget's definition of the DATA macro with something
like this...
#define DATA WIDGET_DATA(0,mywidgetdata)
...where "0" is the number of classes your widget is subclassing,
"mywidget" is the name of the widget, and "struct mywidgetdata"
is the structure containing your widget's private data members.
+ Replace your widget's private member allocation code (usually a
g_malloc/errorcheck/memset combination) with the macro:
WIDGET_ALLOC_DATA(0,mywidgetdata)
This assumes the local variable "g_error e;" is defined. Again,
"0" is your widget's subclass number and "mywidgetdata" is its
private data structure.
+ Replace your widget's private member deletion code (usually
a call to g_free(self->data);) with:
g_free(DATA);
+ Make sure your widget does NOT access self->data directly, as
your widget will not be subclassable, and will cause a memory leak.
- Using this subclassing support, I finished a "dialogbox" widget that
subclasses the "popup" widget and sets up a standard dialog title,
settable with PG_WP_TEXT.
- Under development, there are the "simplemenu" and "messagedialog"
widgets. Porting the rest of the standard dialogs to the server side
(as much as possible) is planned.
- Numerous cleanups in the widget code
- The panel widget was modified to support an additional border drawn
around both the panelbar and its contents. This border's size may be
set with the panel::border.size theme property, and it is painted with
the panel::border.fill fillstyle.
This should all lead to cleaner code in pgserver and less complexity in the client
library.
--
Only you can prevent creeping featurism!
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Pgui-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pgui-devel