EagleEye
unread,Aug 12, 2008, 4:15:02 AM8/12/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to EEGUI
The classes I just sent in that last email were all things I was using
to build a custom chat box.
With a GUI being built on so many pieces, with so many layers of
inheritance, it can be a daunting task... and difficult to follow for
newer programmers... but I tell ya what, when I get this chat window
thing done, I'll be sure to try to explain it all as well as I can.
A little overview, though:
My intention is to make a reusable "ChatWindow" class that can be used
somewhat like IRC, where you can have multiple instances of the
class... one for each chat room you're in.
The chat room has the following components:
Title bar that acts as a window handle, with control box.
(WindowHandle class)
Messages are (where chat messages are displayed) (ChatMessageArea
class)
User list (UserList Class)
Message input (ChatInputArea class)
Send button (StdButton class)
Resizer (MyResizer class, and part of the base ResizbleWindow class)
All of these components are arranged to fill an entire base window
(the inherited StdWindow, that is the base class for ChatWindow).
You can see a basic example of my as-yet-incomplete chat window in the
file section of this group.
Anyway...
The inheritance path goes like this:
ChatWindow -> ResizableWindow -> StdWindow -> guiControlBase
-- (TitleBar) WindowHandle -> StdLabel -> guiLabel -> guiControlBase
-- -- (ControlBox) ControlBox -> StdWindow -> guiControlBase
-- (UserList) UserList -> StdListBox -> guiListBox ->
guiScrollingWindow -> guiControlBase
-- (MessageArea) ChatMessageArea -> StdListBox -> guiListBox ->
guiScrollingWindow -> guiControlBase
-- (InputArea) ChatInputArea -> StdTextBox -> guiTextBox -> guiLabel -
> guiControlBase
-- (btnSend) StdButton -> guiButton -> guiLabel -> guiControlBase
-- (ResizableWindow.Resizer) MyResizer -> guiControlBase
So you see, there are many levels here...
Each level is intended to either handle a certain functionality, or
cause a certain visual style.
the guiXYZ controls are strictly function oriented, and contain no
preference towards one visual style or another.
I inherit from them with "StdXYZ" controls (STD = Standard), as a base
"look and feel" for my app. For example, I know most of my labels are
going to have a left-aligned text layout, and use a similar font.
I can further inherit from these Std types, to change little aspects,
such as the font index, the text alignment, or background textures...
or even sizes.
For example, on the login page, I'm using StdLabel, and StdLabelSmall,
which inherits from StdLabel. The only real difference is that the
StdLabelSmall has a different font index, with a smaller font. Even
so, I'm inheriting from BOTH of those, specifically for LoginLabel
(inherits StdLabel), and NewAccountLabelSmall (inherits
StdLabelSmall), so I can specify backgrounds SPECIFICALLY for that GUI
interface. This way I don't have to worry about a single change (to
change my login screen's look and feel) changing other interfaces deep
inside the game.
I can also set them up to use specific textures that are unique to
that screen, without changing other labels elsewhere in the app. (Or,
in this case, simply have all of the backgrounds disabled, so the
background texture of the sign in window can show through, or
eventually, the rendered scene.)
Anyway... that's all I have for now as far as the chat window...
More to come later!