From 18be0179610b4f1311cad50c155e7646083d1cf8 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sun, 15 Jan 2006 19:06:33 +0000 Subject: Initial completed version --- mwidget.mod/mwidget.bmx | 167 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-) diff --git a/mwidget.mod/mwidget.bmx b/mwidget.mod/mwidget.bmx index 00ca593..8a2a09f 100644 --- a/mwidget.mod/mwidget.bmx +++ b/mwidget.mod/mwidget.bmx @@ -2296,7 +2296,7 @@ Type TMCanvas Extends TMWidget Rem bbdoc: Creates a managed canvas. returns: The created canvas. - about: @x, @y, @w, @h, @group, @style and @gfxflags act the same as the MaxGUI arguments to @CreateTreeView(), except that @group is a TMWidget. + about: @x, @y, @w, @h, @group, @style and @gfxflags act the same as the MaxGUI arguments to @CreateCanvas(), except that @group is a TMWidget. EndRem Method Create:TMCanvas(x:Int, y:Int, w:Int, h:Int, group:TMWidget, style:Int=0, gfxflags:Int=GRAPHICS_BACKBUFFER) OnRedrawEvent=New TMWEventListVoid @@ -2454,7 +2454,7 @@ Type TMToolbar Extends TMWidget Rem bbdoc: Creates a managed toolbar. returns: The created toolbar. - about: @source, @group and @style act the same as the MaxGUI arguments to @CreateComboBox(), except that @group is a TMWidget. + about: @source, @group and @style act the same as the MaxGUI arguments to @CreateToolBar(), except that @group is a TMWidget. If @values is not NULL it is used to load up the initial options. IMPORTANT: It is really not recommended to use COMBOBOX_EDITABLE as OnIndexChanged() is called when the user edits the field. There seems to be no easy way to remedy this. @@ -2515,6 +2515,169 @@ Type TMToolbar Extends TMWidget End Type +Rem +bbdoc: Defines a managed panel. +EndRem +Type TMPanel Extends TMWidget + + Rem + bbdoc: Creates a managed panel. + returns: The created panel. + about: @x, @y, @w, @h, @group, @style and @title act the same as the MaxGUI arguments to @CreatePanel(), except that @group is a TMWidget. + EndRem + Method Create:TMPanel(x:Int, y:Int, w:Int, h:Int, group:TMWidget, style:Int=0, title:String="") + OnButtonDownEvent=New TMWEventListInt + OnButtonUpEvent=New TMWEventListInt + OnMouseMoveEvent=New TMWEventListIntInt + OnMouseWheelEvent=New TMWEventListInt + OnKeyDownEvent=New TMWEventListInt + OnKeyUpEvent=New TMWEventListInt + OnKeyEvent=New TMWEventListInt + BaseInitialise(CreatePanel(x,y,w,h,group.gadget,style,title),group) + typename="TMPanel" + Return Self + End Method + + Rem + bbdoc: Called when the a mouse button is pressed. + about: @button is the pressed button. + EndRem + Method OnButtonDown(button:Int) + End Method + + Rem + bbdoc: Called when the a mouse button is pressed. + EndRem + Field OnButtonDownEvent:TMWEventListInt + + Rem + bbdoc: Called when the a mouse button is released. + about: @button is the released button. + EndRem + Method OnButtonUp(button:Int) + End Method + + Rem + bbdoc: Called when the a mouse button is released. + EndRem + Field OnButtonUpEvent:TMWEventListInt + + Rem + bbdoc: Called when the mouse moves. + about: @x and @y are the mouse co-ordinates. + EndRem + Method OnMouseMove(x:Int, y:Int) + End Method + + Rem + bbdoc: Called when the an item is selected. + EndRem + Field OnMouseMoveEvent:TMWEventListIntInt + + Rem + bbdoc: Called when the mouse wheel moves. + about: @delta is the amount the wheel moves. + EndRem + Method OnMouseWheel(delta:Int) + End Method + + Rem + bbdoc: Called when the mouse wheel moves. + EndRem + Field OnMouseWheelEvent:TMWEventListInt + + Rem + bbdoc: Called when a key is held down. + about: @code is the key code. + EndRem + Method OnKeyDown(code:Int) + End Method + + Rem + bbdoc: Called when a key is held down. + EndRem + Field OnKeyDownEvent:TMWEventListInt + + Rem + bbdoc: Called when a key is released. + about: @code is the key code. + EndRem + Method OnKeyUp(code:Int) + End Method + + Rem + bbdoc: Called when a key is released. + EndRem + Field OnKeyUpEvent:TMWEventListInt + + Rem + bbdoc: Called when a key character is generated. + about: @code is the unicode value. + EndRem + Method OnKey(code:Int) + End Method + + Rem + bbdoc: Called when a key character is generated. + EndRem + Field OnKeyEvent:TMWEventListInt + + Method Handle(e:TEvent) + Select e.id + Case EVENT_MOUSEDOWN + OnButtonDown(e.data) + OnButtonDownEvent.Fire(Self,e.data) + Case EVENT_MOUSEUP + OnButtonUp(e.data) + OnButtonUpEvent.Fire(Self,e.data) + Case EVENT_MOUSEMOVE + OnMouseMove(e.x,e.y) + OnMouseMoveEvent.Fire(Self,e.x,e.y) + Case EVENT_MOUSEWHEEL + OnMouseWheel(e.data) + OnMouseWheelEvent.Fire(Self,e.data) + Case EVENT_KEYDOWN + OnKeyDown(e.data) + OnKeyDownEvent.Fire(Self,e.data) + Case EVENT_KEYUP + OnKeyUp(e.data) + OnKeyUpEvent.Fire(Self,e.data) + Case EVENT_KEYCHAR + OnKey(e.data) + OnKeyEvent.Fire(Self,e.data) + Default + super.Handle(e) + End Select + End Method +End Type + + +Rem +bbdoc: Defines a managed progress bar. +EndRem +Type TMProgressBar Extends TMWidget + + Rem + bbdoc: Creates a managed progress bar. + returns: The created progress bar. + about: @x, @y, @w, @h, @group and @style act the same as the MaxGUI arguments to @CreateProgBar(), except that @group is a TMWidget. + EndRem + Method Create:TMProgressBar(x:Int, y:Int, w:Int, h:Int, group:TMWidget, style:Int=0) + BaseInitialise(CreateProgBar(x,y,w,h,group.gadget,style),group) + typename="TMProgressBar" + Return Self + End Method + + Rem + bbdoc: Set the value for the progress bar. + about: @value is the value (between 0 and 1). + EndRem + Method SetValue(value:Double) + UpdateProgBar(gadget,value) + End Method +End Type + + Rem bbdoc: Enters the event processing loop. about: @top is the top level TMWindow For the application. The loop continues Until the @closed Field of this window is TRUE. -- cgit v1.2.3