Author Topic: GUI Librarie  (Read 4558 times)

0 Members and 1 Guest are viewing this topic.

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
GUI Librarie
« on: September 12, 2016, 12:53:37 pm »
Hi guys !
I'm working on a Librarie which provides widgets for your GUIs, like a button, an alert, a popup and more.
For now, I only have 23 funcs  ;D :
FillRect(x1,y1,x2,y2)Draw a filled rectangle on the main buffer.
Rect(x1,y1,x2,y2)Draw a rectangle on the main buffer.
PopUp(x,y,Title,Str,Line)Title must be a zero-terminated string
Str must be a zero-terminated string
Line is the number of zero-terminated string in Str
Draw a PopUp at x,y on the main buffer.
DimStr(Str)Thanks to jacobly for this function
This one return the lenght in pixel of the string
ProgressBar(x,y,weidth,height,pause)weidth is the number of pixel in the ProgressBar. If 3 is the weidth, the progressbar will have 5 pixel of weidth with the border
height is the number of pixel without border (2 pixel)
pause is the time between each percent
Draw a progress bar on the screen. It is possible to quit with [clear]. That generate an Alert (cf alert)
Button(x,y,Str,Nbr)Draw a non-filled Button at x,y on the main buffer.
Str must be a zero-terminated string
Nbr is the number of zero-terminated string in Str
Alert(Title,Str)Draw an alert on the main buffer.
Title must be a zero-terminated string
Str must be a zero-terminated string composed by one of these.
ClrAll()Clear all screen (screen, main buffer and back buffer)
ClrAllBuf()Clear only all buffer
ClrMainBuf()Clear only the main buffer
ClrBackBuf()Clear only the back buffer
Disp4Color()Draw the main and back buffer to the screen to create 4 color
Disp3Color()Draw the main and back buffer to the screen to create 3 color
Disp2Color()Draw the main buffer to the screen
IndicOff()Turns off the run indicator
DoneOff()The program will not display "done" after finishing
SetCont(cont)Set the LCD contrast (0 is lightest, 63 is darkest)
RetCont()Return the LCD contrast value
SaveMainBuf()Save the main buffer to the back buffer
RclBackBuf()Copy the back buffer to the main buffer
Screenshot()Takes a screenshot and saves it to the main buffer
DispSprt(x,y,sprt)Sprt must be create in this form:
[xxxxxxxx]->ptr
[xxxxxxxx]
[xxxxxxxx]
[xxxxxxxx]
[xxxxxxxx]
[xxxxxxxx]
[xxxxxxxx]
[xxxxxxxx]
x must be a 0 (clear the pixel at this point), a 1 (draw a pixel at this point), a 2 or other (draw or clear a pixel depending on the pixel at this point)
This function draw a sprite at x,y on the main buffer
MiniButton(x,y,str)Draw a filled button at x,y on the main buffer
str must be a zero-terminated string composed by only one of these


Thank you in advance for your returns.
neuronix
« Last Edit: September 12, 2016, 01:04:59 pm by neuronix »

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Re: GUI Librarie
« Reply #1 on: September 12, 2016, 03:32:52 pm »
Looks nice!  :)
Why are there rectangle commands? Axe already has them built in and they have some functions that yours cannot. (such as rendering partly on the screen)
Also there are a lot commands such as ClrMainBuf that are just one command that you can leave out unless you were just trying to rename the command.
What you have looks nice, but you should eliminate the repetitive parts.
It appears you are trying to emulate the DoorsCS libraries. An axiom already exists for that. (but you might be trying to allow use without needing to have Doors installed)
« Last Edit: September 12, 2016, 03:39:30 pm by E37 »
I'm still around... kind of.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: GUI Librarie
« Reply #2 on: September 13, 2016, 02:00:07 am »
Looking nice! It reminds me of the DCS gui stack, axioms for that are already available, e.g. here! ^.^

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline neuronix

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 108
  • Rating: +0/-0
    • View Profile
Re: GUI Librarie
« Reply #3 on: September 13, 2016, 11:08:47 am »
Thank you very much
If you have any idea, don't hesitate ;)