[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    DialogCore / AboutCore classes
From:       Espen Sand <espen.sand () neo ! no>
Date:       1999-08-30 8:36:58
[Download RAW message or body]

FYI: From My Struggle towards (even) better dialogs in KDE.

I have been working this weekend on a dialog base class - DialogCore
The reason for this is to make a class that more or less forces the user to
follow certain rules when making dialogs. My goal is to get this class into 
kdeui so that I can use it in other (than khexedit) programs I have planned to
"clean up".


*DialogCore provides three layouts (defined in constructor)
+Plain (std dialog)
+Tabbed (a tabbed dialog)
+TreeList (treelist+pages as config window in khexedit, korganizer). The
treelist is based on the QSplitter + QlistView.

*DialogCore defines an inner and outer margin. The outer is used by the
DialogCore itself and and the user should use the "innerMagin()" only.
(I hope DialogCore can read these margins from a central KDE object later).

*DialogCore is modeless (by default).

*The dialog caption is automatically set to:
"<appName>: <titletext provided in constructor>"  

*A separator can be created above the Action button (not by default)

Action Buttons:
*The layout below will be used:
<Help><Default>[stretchable space]<User3><User2><User1><Apply><Ok><Cancel> 
*Defined in constructor
*A default button is defined (in constructor)
*<Cancel> can be replaced by <Close> but one of them must be present
*Any combination is allowed (but the sequence remains) eg:
<Help><Default>[stretchable space]<Apply><Ok><Cancel> 
[stretchable space]<Print><Ok><Cancel> (User1 is defined as <Print>) 
*Buttons can be grayed out
*The dialog provides virtual slots for all buttons.
*All buttons use an accelerator (except for the user definable)
*The buttonbox uses the innerMargin() and outerMargin()


I have successfully converted all dialogs in khexedit to subclass
from DialogCore. The resulting binary file is smaller and the code
is easier to read (and less translations is required).

I have begun making a general "about dialog" core class, AboutCore, that will be
able to create the "About KDE dialog" as well as my current "About khexedit" and
more. The  AboutCore is sublassed from the "DialogCore". I can
already make the "About KDE dialog" using this class. I will try to implement
all features from the (nice :-) "KAboutDialog" by Mirko Sucker. 


-- 
Espen Sand

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic