Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
UI-System Design #396173
03/03/12 16:50
03/03/12 16:50
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Heyo Guys,

I am stuck with LiteGUI again because I am not sure how to design the user solution for it. My main problem is, that every element has an ridiculous amount of members.

Example: A button consists of an metric struct (x,y,width,height,scaleX,scaleY,alignX,alignY,angle,alpha,layer) and a system struct (events,flags) and the "specific" struct, which consists of 4 BMAPs, 4 label structs and a disabled-bool.
The label struct again consists of a string, fontString, color, italic/bold bools and a size.

And if I leave out more things, it will make the whole thing less usable for more people smirk



Ideas?


(Btw, the user does not have to apply all settings, as the struct will always be filled with standard-values from a user/default configuration file in json.)

Regards,
Marian

Re: UI-System Design [Re: Rei_Ayanami] #396179
03/03/12 18:21
03/03/12 18:21
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Just make differnt Contructors, with different amounts of parameters passed. (filling in default values)
To keep having simple contructors.

Re: UI-System Design [Re: Damocles_] #396259
03/04/12 21:11
03/04/12 21:11
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Hmn, this would require a rewrite of the whole user system, as the actual "create" function looks like this:

Code:
void *LGcreateObject(ESdefineStruct *createStruct);



define struct:

Code:
typedef struct ESdefineStruct 
{
	int objType;
	ESmetricStruct *metrics;
	ESsystemStruct *system;
	void *specific;
} ESdefineStruct;



(I already explained the containing structs above)

Re: UI-System Design [Re: Rei_Ayanami] #396355
03/05/12 23:47
03/05/12 23:47
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Use datatype RECT for x, y, width and height, create POINT if it doesn't already exist for scaleX,Y and alignX,Y.

You could also have a default size defined

LiteGuiLabelDefaults(POINT* scale, POINT* align) so when these aren't passed they're used for default values
have LiteGuiLabelFlag(LABEL* lbl, long flags) for being able to set things after they're created

also support similar to most application Ex for each function
LiteGuiLabelEx(where you do pass every possible parameter)

Just food for thought


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1