- Posts: 168
GUI
- MatCat
-
Topic Author
- Offline
Less
More
04 May 2012 18:41 #182
by MatCat
Replied by MatCat on topic Re: GUI
Any chance to add disabling of the variable unused warning on the compiler? It is the bulk of warnings as each GUI element's ID is stored in a variable but not specifically used in the same code block, other then making an ugly if statement just to check every gui variable to keep it from giving warnings...
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
04 May 2012 19:13 #183
by MatCat
Replied by MatCat on topic Re: GUI
In experimenting I noticed eclipse has code stylings, it appears GNU code styling is closest to what you described we should use, if that is the case I can easily switch to it and just hit ctrl+shft+f and get it formatted properly 
I have removed all warnings except the unused variables, removed all tabs, as far as code style goes I will wait on clarification.
The available options are: K&R, BSD, GNU, Whitesmiths
Generally I don't care too much about code styles as most code I work on is private party stuff and I just use my own style.
I have removed all warnings except the unused variables, removed all tabs, as far as code style goes I will wait on clarification.
The available options are: K&R, BSD, GNU, Whitesmiths
Generally I don't care too much about code styles as most code I work on is private party stuff and I just use my own style.
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
05 May 2012 04:28 #186
by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
The style I use is pretty close to 1TBS. I was able to get close in Eclipse, by
* making a new style with K&R as the base
* changing indentation to 'spaces only'
* selecting for braces: function -> next line
* selecting for braces: blocks -> next line on wrap
If you setup that style in Eclipse, it will closely math my code. Please only format the files you've created (in the gui dir) as otherwise the merge will be quite difficult.
As far as widgets:
I think we need a 'volume bar' or something equivalent that can be used to show the current position of the sticks.
We'll likely want some sort of x/y graph to allow displaying/setting the expo curves
We'll probably want an 'image button' (where an image, rather than text is shown on the button)
My order of priority would probably be something like:
volume-bar
scrollbar
image button
drowpdown
keyboard w/ entry box
radial button
x/y graph
animated sprite
You may have other methods in mind for the examples I gave above, so feel free to ignore me.
* making a new style with K&R as the base
* changing indentation to 'spaces only'
* selecting for braces: function -> next line
* selecting for braces: blocks -> next line on wrap
If you setup that style in Eclipse, it will closely math my code. Please only format the files you've created (in the gui dir) as otherwise the merge will be quite difficult.
As far as widgets:
I think we need a 'volume bar' or something equivalent that can be used to show the current position of the sticks.
We'll likely want some sort of x/y graph to allow displaying/setting the expo curves
We'll probably want an 'image button' (where an image, rather than text is shown on the button)
My order of priority would probably be something like:
volume-bar
scrollbar
image button
drowpdown
keyboard w/ entry box
radial button
x/y graph
animated sprite
You may have other methods in mind for the examples I gave above, so feel free to ignore me.
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
05 May 2012 04:32 #187
by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
I just checked in new font drawing code that supports proportional fonts, and added 3 new proportional fonts, and one new fixed font (and got rid of some broken ones)
I like the Arial font (font #6), but it is a 10x14 proportional font (as opposed to the 8x8 fixed font we're currently using) and it doesn't center properly on your buttons.
I like the Arial font (font #6), but it is a 10x14 proportional font (as opposed to the 8x8 fixed font we're currently using) and it doesn't center properly on your buttons.
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
05 May 2012 05:59 #190
by MatCat
Replied by MatCat on topic Re: GUI
Ok cool. I also agree with your assesment of widgets too. I am trying to keep it very modular and use GUI elements to build more complex ones.
For buttons I am going to do:
Image Button (I had already planned this one
)
Imageless Button (Keyboard can be a bmp)
For analogs, what about a centered (except for throttle) design, which lights up either up, down, left, or right from center point? We can use the same concept for trims too.
I will probably do animated sprites soon, because I am working on doing the boot up / bind segmant which will look spiffy with an animation
.
One thing I am worried about is the redraw speed, I hope it is mostly the emulator but I am not sure. I noticed bmps draw very fast, but text draw seems slow, which results in ugly flicker, but then again even the stock firmware has flicker if you mess with it right. I miss the large quanity of ram I am used to with normal PC programming
.
For buttons I am going to do:
Image Button (I had already planned this one
Imageless Button (Keyboard can be a bmp)
For analogs, what about a centered (except for throttle) design, which lights up either up, down, left, or right from center point? We can use the same concept for trims too.
I will probably do animated sprites soon, because I am working on doing the boot up / bind segmant which will look spiffy with an animation
One thing I am worried about is the redraw speed, I hope it is mostly the emulator but I am not sure. I noticed bmps draw very fast, but text draw seems slow, which results in ugly flicker, but then again even the stock firmware has flicker if you mess with it right. I miss the large quanity of ram I am used to with normal PC programming
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
06 May 2012 21:32 #199
by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
The GUI is now working on the actual hardware. It seems to be identical to running in the emulator 
However, refresh is very slow, and setting ReDraw too frequently makes it unusable (I've disabled setting Redraw except by pressing buttons on the GUI for now. The screen flickers badly during refresh as well.
But all things considered I'm quite happy with it.
However, refresh is very slow, and setting ReDraw too frequently makes it unusable (I've disabled setting Redraw except by pressing buttons on the GUI for now. The screen flickers badly during refresh as well.
But all things considered I'm quite happy with it.
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
06 May 2012 22:26 #205
by MatCat
Replied by MatCat on topic Re: GUI
You might need to elaborate a little further...
What I am thinking might just be somewhat the same idea you are saying... basically if text changes redraw the portion of image below it only, though this will add a bit of code to figure out what exactly does need to be redrawn.
I am going to contimplate it and see if I can come up with any other alternative ideas... Perhaps look up other devices with open source firmware and see how they handle gui redraw.
What I am thinking might just be somewhat the same idea you are saying... basically if text changes redraw the portion of image below it only, though this will add a bit of code to figure out what exactly does need to be redrawn.
I am going to contimplate it and see if I can come up with any other alternative ideas... Perhaps look up other devices with open source firmware and see how they handle gui redraw.
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
06 May 2012 22:41 #206
by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Yes this is what I mean. Basically you call a function 'set window' which defines a window to redraw, then you repaint the entire image. The paint routines are then optimized to only paint within the rectangle and ignore everything else. To do it effectively, you need to optimize the drawing routines so that(for instance) you don't need to read the entire background image to repaint a small rectangle. You also need to store the size and location of each gui object so you know how to define the window.
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- PhracturedBlue
-
- Offline
Less
More
- Posts: 4403
07 May 2012 04:42 #209
by PhracturedBlue
Replied by PhracturedBlue on topic Re: GUI
Well, I just committed code to get the sound working. I believe I have implemented basic interfaces to all of the hardware now. So once MatCat has the GUI Framework mostly done, and rcH4x0r has a radio stack, we should be able to implement a functional transmitter.
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
- MatCat
-
Topic Author
- Offline
Less
More
- Posts: 168
Time to create page: 1.192 seconds