[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-dev] small fixes and template question
From: |
Martin Bickel |
Subject: |
[paragui-dev] small fixes and template question |
Date: |
Mon, 05 Sep 2005 21:56:53 +0200 |
Hi,
here are some small improvements for Paragui, which should be
self-explanatory. I've also replaced the type-cast in
pglistboxbaseitem.cpp to use RuntimeTypeInformation to make it at least
return a NULL-Pointer if it goes wrong. I think we can assume to have
RTTI available, can't we?
But the design should definitly be fixed in that area. I tried changing
PG_ListBoxItem constructor to only accept PG_ListBox* as parent, but
this breaks PG_DropDown::AddItem , because it constructs PG_ListBoxItem
with a PG_DropDown as parent. I think this is a major design error,
because the current C-style cast will result in complely unpredictable
behaviour in that case.
And I have a question about the signal definition, which I've been
wondering about since I've first seen them. What is the purpose of a
templated signal definition like this:
class Something {
template<class datatype = PG_Pointer> class SignalButtonClick : public
PG_Signal1<PG_Button*, datatype> {};
SignalButtonClick<> sigClick;
What's the difference to a non-templated definition like:
typedef PG_Signal1<PG_Button*, PG_Pointer> SignalButtonClick;
SignalButtonClick sigClick;
This first one is obviously a member template, but while I can see the
purpose of member template functions, I've got real problems
understanding data member templates.
Martin
patch
Description: Binary data
- [paragui-dev] small fixes and template question,
Martin Bickel <=