News:

Function Finder  Find all the functions within source code files

Main Menu

Flexi Windows

Started by kevin, January 22, 2005, 08:38:03 AM

Previous topic - Next topic

BlinkOk

cool.
combo and list boxes would be the shizzle though. lol:)

kevin

:) .. but ya could always use WinGUI for more complex (window styled) user interfaces.

BlinkOk


kevin

#33
Scroll Bars Done
 
 This piccy has both the H/V scroll bars in and running.

kevin


kevin

Picture Boxes

 Well, I've implemented a simple picture box.  While it's pictured with scroll bars attached to it, those are manually implemented in code.  Since at this point controls can't have their dependant controls.  If they could, I could build more complex controls out of a group of existing base controls.  But time is getting away from me.  The purpose of this gui update was simply to implement enough functionality to enable it to be used in PlayMapper.  That's it.

kevin

Text Boxes (single line)

 And here we  have single line text boxes up and running.  While there's some cosmetic work to be done, that pretty much completes the base gadget set that I thought i'd need.  

  The input works pretty well, it's smart enough to manage the refresh so that only changes the input state effect the redrawing the gadget and subsequently it's parent window. This smoothes out the performance a great deal, and virtually makes missed key strokes a thing of the past.  It's certainly not infallible though.

kevin

#37
Flex GUI V0.29

 Well, here's the current build of the Flexi GUI library.  It's a bit of mish mash of approaches internally, but it works :)



Window Features:

* Basic controls Resize, Drag, click to front,

* Windows have prioritys, Windows are grouped and drawn based on their priority

* Optional palette(s)

* Optional window gadgets (minimized, maximize and close)

* Mouse over highlights

* Event Driven
---> User can catch MouseOver,MouseClick, resize, redraw, create, delete, etc
---> Windows can control their own refresh rate (either delta time a FPS rate)
---> System events and be over written, So you can make your own control functions to over ride

* Windows are linkable.

* TaskBar for minimized windows. User can catch events on Task bar. Currently their can only be one task bar active at once.



Gadgets:

* Labels  
 * Text Box
 * Command Button
 * Check Boxes
 * Picture Box
 * V scrollers
 * H scrollers


Download Flexi Gui Demo V0.29 (850k) (login required)


Here's the demo code
PlayBASIC Code: [Select]
; create THE taskbar  (only one is supported)  
MyTaskBar=FlexiCreateTaskBar()


Dim MyWIndows(5)


LogoImage=GetFreeImage()
LoadImage "flex_gui.bmp",LogoImage


#IF PBCompileMode=0
BackPath$="../../"
#ELSE
BackPath$=""
#ENDIF


BAckGroundImage=GetFreeImage()
LoadImage BackPath$+"gfx/bg22.jpg",BackGroundImage

BAckGroundImage2=GetFreeImage()
LoadImage BackPath$+"gfx/back20.jpg",BackGroundImage2


MousePOinterIMage=GetFreeImage()
LoadImage "gfx\mouse.bmp",MousePOinterIMage
ImageMaskColour MousePOinterIMage,$ff00ff


MyClock=FlexiCreate("win",200,300)
FlexiSetTitle(MyClock,"Simple Clock")
FlexiPosition(MyClock,Rnd(GetScreenWidth()-200),Rnd(GetScreenHeight()-200))
; FlexiAllowResize(MyClock,false)
FlexiStyle(MyClock,%001)

FlexiOpen(MyClock)
FlexiAutoFresh(MyClock,Timer(),250)


; Make a window with NO border that has absolute priority
WinBoarderLess=FlexiCreate("win",320,200)
FlexiStyle(WinBoarderLess,%001)
FlexiPosition(WinBoarderLess,Rnd(100),Rnd(100))
FlexiBoarderLess(WinBoarderLess)
FlexiFpsFresh(WinBoarderLess,Timer()+15,30)
; FlexiPriority(WinBoarderLess,5)

FlexiOpen(WinBoarderLess)






MyWindow=FlexiCreate("win",GetImageWidth(logoimage)+100,GetImageHeight(LogoIMage)+100)
FlexiSetTitle(myWindow,"Blank Window")
FlexiPosition(MyWindow,Rnd(GetScreenWidth()-200),Rnd(GetScreenHeight()-200))
; FlexiAllowResize(MyWindow,false)
FlexiStyle(MyWindow,%101)
FlexiOpen(MyWindow)


MyPalette=FlexiNewPalette()
; FlexiSetPalettePens(MyPalette,rndrgb(),rndrgb(),rndrgb(),rndrgb(),rndrgb(),rndrgb())

cl=RGB(20,50,250)
cr=RGB(255,100,200)
FlexiSetPaletteTitle(MyPalette,cL,cR,$ffff80)
FlexiState.CurrentPalette=MyPalette

MyWindow2=FlexiCreate("win",220,100)
FlexiPosition(MyWindow2,Rnd(GetScreenWidth()-200),Rnd(GetScreenHeight()-200))
FlexiSetTitle(myWindow2,"Camera Based Stars")

; FlexiAutoFresh(MyWindow2,Timer(),100)
FlexiFPSFresh(MyWindow2,Timer(),31)
; FlexiAutoFresh(MyWindow2,Timer(),33)

FlexiOpen(MyWindow2)


MyPalette=FlexiNewPalette()

; FlexiSetPalettePens(MyPalette,rndrgb(),rndrgb(),rndrgb(),rndrgb(),rndrgb(),rndrgb())
FlexiSetPaletteTitle(MyPalette,$ff00ff,$00fff0,$ffff80)

FlexiState.CurrentPalette=MyPalette


MyWindow3=FlexiCreate("win",250,200)
FlexiSetTitle(myWindow3,"Hello World")
FlexiPosition(MyWindow3,Rnd(GetScreenWidth()-200),Rnd(GetScreenHeight()-200))
FlexiOpen(MyWindow3)



FlexiState.CurrentPalette=1
For lp=0 To GetArrayElements(MyWIndows(),1)
w=RndRange(50,250)
h=RndRange(50,100)
MyWindows(lp)=FlexiCreate("win",w,h)
FlexiPosition(MyWindows(lp),Rnd(GetScreenWidth()-200),Rnd(GetScreenHeight()-200))
FlexiSetTitle(MyWindows(lp),"My Window"+Str$(lp))

ThisLabel=FlexiCreateLabel("Hello There:",100,100,MyWindows(lp))
ThisLabel2=FlexiCreateLabel("Hello:",100,200,MyWindows(lp))

ThisLabel3 =FlexiCreategadget("label",50,60,150,15,MyWindows(lp))
FlexiSetCaption(ThisLabel3,"Thislabel3")

FlexiSetAlignment(ThisLabel3,FlexGadJustify_Right)


ThisCmdButton=FlexiCreateCmdButton("Command Me:",100,150,100,22,MyWindows(lp))

;l FlexiWindows(index).BackGroundImage =ThisImage

If Rnd(1)
FlexiBackDrop(Mywindows(lp),BAckGroundImage)
Else
FlexiBackDrop(Mywindows(lp),BAckGroundImage2)
EndIf

For Checklp=0 To 10
x=200+(checklp*20)
y=100+(checklp*20)
FlexiCreateCheckBox(x,y,10+checklp,Mywindows(lp))
Next

FlexiOpen(MyWindows(lp))
LastWindow=MyWindows(lp)
Next



ThisVscroll =FlexiCreategadget("vscroll",40,40,16,250,LastWindow)
FlexiSetValueRange(ThisVscroll,0,10)
FlexiSetValue(ThisVscroll,6)
FlexiOpen(ThisVscroll)

ThisVscroll2 =FlexiCreategadget("vscroll",80,40,16,250,LastWindow)
FlexiSetValueRange(ThisVscroll2,0,100)
FlexiSetValue(ThisVscroll2,50)
FlexiOpen(ThisVscroll2)


ThisHscroll2 =FlexiCreategadget("hscroll",100,40,160,20,LastWindow)
FlexiSetValueRange(ThisHscroll2,0,100)
Login required to view complete source code