181 |
exUndo, An Undo operation is performed (CTR + Z), exRedo, A Redo operation is performed (CTR + Y). exUndoRedoUpdate, The Undo/Redo queue is updated
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value case (default:value;32:`exUndoRedoUpdate`;33:`exUndo`;34:`exRedo`)",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value case (default:value;32:`exUndoRedoUpdate`;33:`exUndo`;34:`exRedo`)",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Press CTRL+Z to Undo, CTRL+Y to Redo" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
180 |
exLinkObjects, the user creates an element on the surface. The AllowLinkObjects property specifies the keys combination to allow user to link elements on the surface
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 9 ? `exLinkObjects` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 9 ? `exLinkObjects` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:EndUpdate() DevOut( "Hold SHIFT, click an element, and drag to another element to create a link between them" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
179 |
exEditObject, the user edits the element's caption
PROCEDURE OnClick(oSurface) /*ElementFromPoint(-1,-1).Edit(0)*/ RETURN PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 8 ? `exEditObject` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 8 ? `exEditObject` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:Click := {|| OnClick(oSurface)} /*Occurs when the user presses and then releases the left mouse button over the control.*/ oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Click an element to edit its caption" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
178 |
exCreateObject, the user creates an element on the surface. The AllowCreateObject property specifies the keys combination to allow user to create elements on the surface
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 7 ? `exCreateObject` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 7 ? `exCreateObject` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2"):Selected := .T. oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Double-click on the surface and immediately drag to a new position to create an element" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
177 |
exSelectNothing, the user clicks an empty zone of the surface. The AllowSelectNothing property specifies the keys combination to allow user to select nothing on the surface
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 6 ? `exSelectNothing` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 6 ? `exSelectNothing` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowSelectNothing := .T. oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2"):Selected := .T. oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Select an element, and then click outside to select nothing" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
176 |
exSelectObject, the user clicks the object to get it selected. The AllowSelectObject property specifies the keys combination to allow user to select the object
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 5 ? `exSelectObject` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 5 ? `exSelectObject` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Hold ALT and click, then drag to select elements within the drawn rectangle. Click an element to select it. CTRL + CLick to unselect it" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
175 |
exMoveObject, the user moves the object. The AllowMoveObject property specifies the keys combination to allow user to move the object
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 4 ? `exMoveObject` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 4 ? `exMoveObject` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Move an element" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
174 |
exResizeObject, the user resizes the object. The AllowResizeObject property specifies the keys combination to allow user to resize the object
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 3 ? `exResizeObject` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 3 ? `exResizeObject` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64):AutoSize := .F. oElements:Add("Node <b>2"):AutoSize := .F. oElements:Add("Node <b>3",64,-64):AutoSize := .F. oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Resize an element" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
173 |
exSurfaceHome, the user clicks the Home button on the control's toolbar, so the surface is restored to original position. The Home method has the same effect
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 2 ? `exSurfaceHome` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 2 ? `exSurfaceHome` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Click the Home button" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
172 |
exSurfaceZoom, the user magnifies or shrinks the surface. The AllowZoomSurface property specifies the keys combination to allow user to zoom the surface
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 1 ? `exSurfaceZoom` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 1 ? `exSurfaceZoom` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Click and drag the surface to reposition it" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
171 |
exSurfaceMove, the user scrolls or moves the surface. The AllowMoveSurface property specifies the keys combination to allow user to move / scroll the surface
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(oSurface:FormatABC("value = 0 ? `exSurfaceMove` : value",Operation),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(oSurface:FormatABC("value = 0 ? `exSurfaceMove` : value",Operation),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() DevOut( "Click and drag the surface to reposition it" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
170 |
FormatABC method formats the A,B,C values based on the giving expression and returns the result
|
169 |
FreezeEvents(Freeze) method prevents firing any event. For instance, FreezeEvents(True) freezes the control's events, no no event is fired, until the FreezeEvents(False) is called
PROCEDURE OnEvent(oSurface,EventID) DevOut( Transform(oSurface:EventParam(-2),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:Event := {|EventID| OnEvent(oSurface,EventID)} /*Notifies the application once the control fires an event.*/ oSurface:FreezeEvents(.T.) DevOut( "No event is fired after FreezeEvents(True) call" ) oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 3/*exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
168 |
The exAllowChangeFrom(0x20)/exAllowChangeTo(0x40) flag of LinkControlPointEnum type allows the user to adjust the link's from/to element by dragging and dropping the start control point (requires the exStartControlPoint/exEndControlPoint flag)
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(Operation,"") ) DevOut( Transform(oSurface:FocusLink:ID(),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(Operation,"") ) DevOut( Transform(oSurface:FocusLink:ID(),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 99/*exAllowChangeTo+exAllowChangeFrom+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oElements:Add("Node <b>3",64,-64) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:FocusLink := "L1" oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
167 |
The LayoutStartChanging(exFocusLink)/LayoutEndChanging(exFocusLink) event notifies your application when the user focuses on a new link
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(Operation,"") ) DevOut( Transform(oSurface:FocusLink(),"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(Operation,"") ) DevOut( Transform(oSurface:FocusLink(),"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 3/*exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
166 |
Focus a link
PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(Operation,"") ) RETURN PROCEDURE OnLayoutStartChanging(oSurface,Operation) DevOut( "LayoutStartChanging" ) DevOut( Transform(Operation,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:LayoutStartChanging := {|Operation| OnLayoutStartChanging(oSurface,Operation)} /*Occurs when the control's layout is about to be changed.*/ oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := 3/*exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Node <b>1",-64,-64) oElements:Add("Node <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2),"L1") oSurface:FocusLink := "L1" oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
165 |
The caption is displayed on the back, so the picture overrides it. How can I place the caption on the foreground
|
164 |
Draws a frame arround the link's arrow
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := -1/*0xffffff80+exAllowChangeTo+exAllowChangeFrom+exOrthoArrange+exMiddleControlPoint+exControlPoint+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Element <sha ;;0>A") oElements:Add("Element <sha ;;0>B",164,64) oElements:Add("Element <sha ;;0>B",0,132) oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLink := oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(1)) oLink:ShowLinkType := 3/*exLinkStraight+exLinkDirect*/ oLink:StartPos := 0/*LeftAlignment*/ oLink:ArrowSize := 8 oLink:SetProperty("ArrowColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oLink:SetProperty("ArrowFrameColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oSurface:FitToClient() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
163 |
Draws a frame arround the arrow for all links
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := -1/*0xffffff80+exAllowChangeTo+exAllowChangeFrom+exOrthoArrange+exMiddleControlPoint+exControlPoint+exEndControlPoint+exStartControlPoint*/ oSurface:LinksArrowSize := 8 oSurface:SetProperty("LinksArrowColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oSurface:SetProperty("LinksArrowFrameColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oElements := oSurface:Elements() oElements:Add("Element <sha ;;0>A") oElements:Add("Element <sha ;;0>B",164,64) oElements:Add("Element <sha ;;0>B",0,132) oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLink := oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(1)) oLink:ShowLinkType := 3/*exLinkStraight+exLinkDirect*/ oLink:StartPos := 0/*LeftAlignment*/ oSurface:FitToClient() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
162 |
Change the size to display the arrow of the link
|
161 |
Change the size to display the arrows for all links
|
160 |
Extends the caption on the element's width
|
159 |
Gets the width/height of the element to fit its content ( as if the AutoSize property is True )
PROCEDURE OnAnchorClick(oSurface,AnchorID,Options) LOCAL oElement oElement := oSurface:Elements:Item("Account") oElement:Height := oElement:AutoHeight() RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AnchorClick := {|AnchorID,Options| OnAnchorClick(oSurface,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/ oElement := oSurface:Elements():Add("<solidline> <c><b>Bank Account</b></solidline><br>+ owner: String <r><a 1;e64=gA8ABzABvABsABpABkg8JABuABlAAgAA4AAwisXjMYH0TAECMYAjsCMwAM4AkMGhEGOUei0Yl8bkQAOAAlsGmsSlp0h0SgkCF8DgsNhUMhEKiESkYAoMlk8phssmcCltLMNTAFOlFDlc2l0amMxjomAAjAA5AA2tMaHcfplZk1blVDqtuoNXjoAAEBA=>▲</a><br><solidline>+ balance: Currency = 0</solidline><br>+ deposit(amount: Currency)<r><a 2;e64=gA8ABjAA+AECMwAM8DABvABshoAOQAEAAHAAGEWjEajMGNoAMoAOgANERMgAOcHAAvAEJhcEh0Qh0Tg0CmkqMMFlUuhkxiMTisXjNCjk6EwAEYAHIAG1MjY7lUsnkwh8/nUClk5gwAAE" +; "BA==>▲</a><br>+ withdraw(amount: Currency)") oElement:ID := "Account" oElement:X := -128 oElement:CaptionSingleLine := 1/*exCaptionBreakWrap*/ oElement:AutoSize := .F. oElement:Width := 256 oElement:Height := oElement:AutoHeight() oElement:CaptionAlign := 4/*0x4+*/ oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
158 |
Expandable-caption
PROCEDURE OnAnchorClick(oSurface,AnchorID,Options) DevOut( Transform(AnchorID,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement,oElement1,oElement2 LOCAL oLink LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AnchorClick := {|AnchorID,Options| OnAnchorClick(oSurface,AnchorID,Options)} /*Occurs when an anchor element is clicked.*/ oElement := oSurface:Elements():Add("<solidline> <c><b>Bank Account</b></solidline><br>+ owner: String <r><a 1;e64=gA8ABzABvABsABpABkg8JABuABlAAgAA4AAwisXjMYH0TAECMYAjsCMwAM4AkMGhEGOUei0Yl8bkQAOAAlsGmsSlp0h0SgkCF8DgsNhUMhEKiESkYAoMlk8phssmcCltLMNTAFOlFDlc2l0amMxjomAAjAA5AA2tMaHcfplZk1blVDqtuoNXjoAAEBA=>▲</a><br><solidline>+ balance: Currency = 0</solidline><br>+ deposit(amount: Currency)<r><a 2;e64=gA8ABjAA+AECMwAM8DABvABshoAOQAEAAHAAGEWjEajMGNoAMoAOgANERMgAOcHAAvAEJhcEh0Qh0Tg0CmkqMMFlUuhkxiMTisXjNCjk6EwAEYAHIAG1MjY7lUsnkwh8/nUClk5gwAAE" +; "BA==>▲</a><br>+ withdraw(amount: Currency)") oElement:ID := "Account" oElement:X := -256 oElement:Y := -164 oElement:CaptionSingleLine := 1/*exCaptionBreakWrap*/ oElement:CaptionAlign := 4/*0x4+*/ oElement1 := oSurface:Elements():Add("<solidline> <c><b>Person</b></solidline><br>+ name: String <r><a 1;e64=gA8ABzABvABsABpABkg8JABuABlAAgAA4AAwisXjMYH0TAECMYAjsCMwAM4AkMGhEGOUei0Yl8bkQAOAAlsGmsSlp0h0SgkCF8DgsNhUMhEKiESkYAoMlk8phssmcCltLMNTAFOlFDlc2l0amMxjomAAjAA5AA2tMaHcfplZk1blVDqtuoNXjoAAEBA=>▲</a><br><solidline># birth: Date</solidline><br>+ getCurrentAge(): int<r><a 2;e64=gA8ABjAA+AECMwAM8DABvABshoAOQAEAAHAAGEWjEajMGNoAMoAOgANERMgAOcHAAvAEJhcEh0Qh0Tg0CmkqMMFlUuhkxiMTisXjNCjk6EwAEYAHIAG1MjY7lUsnkwh8/nUClk5gwAAEBA==>▲</a>") oElement1:ID := "Person" oElement1:Y := -164 oElement1:CaptionSingleLine := 1/*exCaptionBreakWrap*/ oElement2 := oSurface:Elements():Add("<solidline> <c><b>Student</b></solidline><br><solidline>+ classes: List<Course> <r><a 1;e64=gA8ABzABvABsABpABkg8JABuABlAA+AAgAECMcTi4AMwAM4AjMGhEGOUVAA4AAwk8plcqihwAElg0wiUlOkOiUEgQvgcFhsKhkIhUQiUUnccj0gn0jmMagUlowAMNOpEfkMNkkmlEqrctjQmAAjAA5AA2sssHcbnkdq1Ln1QtVSjQAAEBA==>▲</a></solidline><br>- attend(class: Course)<r><a 2;e64=gA8ABjAA+AECMwAM8DABvABshoAOQAEAAHAAGEWjEajMGNoAMoAOgANERMgAOcHAAvAEJhcEh0Qh0Tg0CmkqMMFlUuhkxiMTisXjNCjk6EwAEYAHIAG1MjY7lUsnkwh8/nUClk5gwAAEBA==>▲</a><br>- sleep()") oElement2:ID := "Student" oElement2:Y := -64 oElement2:CaptionSingleLine := 1/*exCaptionBreakWrap*/ oLink := oSurface:Links():Add(oSurface:Elements:Item("Account"),oSurface:Elements:Item("Student")) oLink:Caption := "<fgcolor A0A0A0><solidline 808080> <c><b>Link</b></solidline><br># count: number <r><a ;exp=12992>➤</a>" oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
157 |
Expandable-caption
|
156 |
Fullfit the caption on the element's width
|
155 |
Wrap the caption by <br> or "\r\n" sequence only
|
154 |
Display a custom tooltip
PROCEDURE OnMouseMove(oSurface,Button,Shift,X,Y) oSurface:ShowToolTip("new content","",,"+8","+8") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oSurface,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
153 |
Shows the tooltip of the object moved relative to its default position
PROCEDURE OnMouseMove(oSurface,Button,Shift,X,Y) oSurface:ShowToolTip("<null>","<null>",,"+8","+8") RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oSurface,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oSurface:Elements():Add("Element with a Tooltip"):ToolTip := "This is a bit of text that should be displayed when cursor hovers the element." oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
152 |
Rename Undo/Redo commands into the control's toolbar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:ToolBarFormat := "-1,100,101,|,103,104" oSurface:SetProperty("ToolBarCaption",100,"<img>1</img>Acasa") oSurface:SetProperty("ToolBarCaption",103,"Anuleaza <img>3</img>") oSurface:SetProperty("ToolBarCaption",104,"<img>4</img>Reface") oSurface:SetProperty("ToolBarToolTip",100,"Restabileste vizualizarea la origine.") oSurface:SetProperty("ToolBarToolTip",101,"Mareste vizualizarea.") oSurface:SetProperty("ToolBarToolTip",103,"Anuleaza ultima actiune UI. Pentru a anula o actiune apasati Ctrl+Z.") oSurface:SetProperty("ToolBarToolTip",104,"Inverseaza cea mai recenta operatie de anulare. Pentru a reface o actiune apasati Ctrl+Y.") oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-48) oElements:Add("Item <b>2",32,32) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
151 |
Add Undo/Redo commands to control's toolbar
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:ToolBarFormat := "-1,100,101,|,103,104" oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-48) oElements:Add("Item <b>2",32,32) oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
150 |
Clear Undo/Redo queue (method 2)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface LOCAL c oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-64) oElements:Add("Item <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) c := oSurface:UndoRedoQueueLength() oSurface:UndoRedoQueueLength := 0 oSurface:UndoRedoQueueLength := c DevOut( oSurface:UndoListAction() ) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
149 |
Clear Undo/Redo queue (method 1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-64) oElements:Add("Item <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:AllowUndoRedo := .T. DevOut( oSurface:UndoListAction() ) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
148 |
Removes Redo operations
|
147 |
Removes Undo operations
|
146 |
Record the UI operations as a block of undo/redo operations
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:StartBlockUndoRedo() oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-64) oElements:Add("Item <b>2") oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:EndBlockUndoRedo() DevOut( oSurface:UndoListAction() ) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
145 |
Groups the next to current Undo/Redo Actions in a single block
|
144 |
Limits the number of entries within the Undo/Redo queue
|
143 |
Lists the Redo actions that can be performed on the surface
|
142 |
Lists the Undo actions that can be performed on the surface
|
141 |
Checks whether the Undo operation is possible
|
140 |
Call Redo by code
|
139 |
Checks whether the Undo operation is possible
|
138 |
Call Undo by code
|
137 |
Save the element's properties for Undo/Redo operations, by code
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oSurface LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Item <b>1",-64,-64) oElements:Add("Item <b>2") oSurface:StartBlockUndoRedo() oLink := oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) h := oLink:StartUpdateLink() oLink:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oLink:Width := 2 oLink:ShowDir := .F. oLink:ShowLinkType := 2/*exLinkStraight*/ oLink:EndUpdateLink(h) oSurface:EndBlockUndoRedo() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
136 |
No color is restored for the link when Undo/Redo operation is executed
PROCEDURE OnAddElement(oSurface,Element) /*Element.ShowCheckBox = True*/ /*Element.CheckBoxAlign = 2*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oSurface LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/ oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Check <b>1",-64,-64) oElements:Add("Check <b>2"):Checked := 1/*exChecked*/ oSurface:StartBlockUndoRedo() oLink := oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) h := oLink:StartUpdateLink() oLink:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oLink:Width := 2 oLink:ShowDir := .F. oLink:ShowLinkType := 2/*exLinkStraight*/ oLink:EndUpdateLink(h) oSurface:EndBlockUndoRedo() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
135 |
Save the element's properties for Undo/Redo operations, by code
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oSurface LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:Elements():Add("Item <b>1",-64,-64) oSurface:StartBlockUndoRedo() oElement := oSurface:Elements():Add("Item <b>2") h := oElement:StartUpdateElement() oElement:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oElement:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oElement:SetProperty("BorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oElement:EndUpdateElement(h) oSurface:EndBlockUndoRedo() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
134 |
No color is restored for the element when Undo/Redo operation is executed
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oSurface LOCAL h oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oSurface:Elements():Add("Item <b>1",-64,-64) oSurface:StartBlockUndoRedo() oElement := oSurface:Elements():Add("Item <b>2") h := oElement:StartUpdateElement() oElement:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 0,0,0 } ) , .F. )) oElement:SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,255,255 } ) , .F. )) oElement:SetProperty("BorderColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. )) oElement:EndUpdateElement(h) oSurface:EndBlockUndoRedo() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
133 |
How can I ensure that a specified element fits the surface's visible area
|
132 |
LayoutEndChanging(exUndo), LayoutEndChanging(exRedo) or LayoutEndChanging(exUndoRedoUpdate) notifiy your application once a Undo/Redo operation is executed (CTRL+Z, CTRL+Y) or updated
PROCEDURE OnAddElement(oSurface,Element) /*Element.ShowCheckBox = True*/ /*Element.CheckBoxAlign = 2*/ RETURN PROCEDURE OnLayoutEndChanging(oSurface,Operation) DevOut( "LayoutEndChanging" ) DevOut( Transform(Operation,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/ oSurface:LayoutEndChanging := {|Operation| OnLayoutEndChanging(oSurface,Operation)} /*Notifies your application once the control's layout has been changed.*/ oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Check <b>1",-64,-64) oElements:Add("Check <b>2"):Checked := 1/*exChecked*/ oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
131 |
Turn on the Undo/Redo feature
PROCEDURE OnAddElement(oSurface,Element) /*Element.ShowCheckBox = True*/ /*Element.CheckBoxAlign = 2*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/ oSurface:BeginUpdate() oSurface:AllowUndoRedo := .T. oElements := oSurface:Elements() oElements:Add("Check <b>1",-64,-64) oElements:Add("Check <b>2"):Checked := 1/*exChecked*/ oSurface:Links():Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
130 |
ImageSize property on 32 (specifies the size of control' icons/images/check-boxes/radio-buttons)
PROCEDURE OnAddElement(oSurface,Element) /*Element.ShowCheckBox = True*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oAppearance LOCAL oElement,var_Element LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/ oSurface:BeginUpdate() oSurface:ImageSize := 32 oSurface:Font():Size := 16 oSurface:Images("gBJJgBAIDAAEg4AEEKAD/hz/EMNh8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wARbjZHiNoDw1nLDnGyNINQ+wjCpBMEgcovQUgICQJEcgWRuBvAyJ4d4ugpCUAINcHogxIgnDiM4N4axzD3F2JMTY/hRqYF6FsWIxhYAGGoAALQYgYirBwBE" +; "BwpAjBEAAIEIYsA2gOHCMAGgXAACIDmMITAUgFABH0D0I4WwvhNFGMAOIvxRD2GKNcMA8gjAPDCPwBogRPAxA8PgRwZRICYDED8RAXQEghEAN8DIgwIBdB4JYWwMgtiQHoFQKAiRFguFKGwGQhglDsEOVwEQQRkCKBwOIHgSREDRBYHEXQcQdD7GIGARQHRxipBrMobgewDCUCADsEYWAzgMHKHQDQxxsDzA6EMfAeQHB4GQDkUYPA0iECiKoGgRhcDdA2GMQA8AOCjDSPgHI4QnApAKBICwHg1A+BcAwcYsgbjGGQNkCIgRsA6EcBEWANADjsB0B8YYzQQDIGSBcEYZBCCPEkFIHQSgkgZAwG4IwBAbAYGGAgL4Ch4g8BOCQAA2KKC0GcAke4AAXAFCoHkDw4xbBFEcJkE4JRSiEFeJYKQVRMgJHODwX4xAgC/AsIIZAeAHDRG0HYI40RKCLEGDUI4jAghwBWIceA+whCpHMFYZYOQxglDMHMBQGxYj" +; "VHiAoBIPgfgHGwPsHYJRSB6A0IERQLhCjJHMA4OQoAoCOACLYGYSx8DpBQIMWQdRnDRH+DsE4fB3CeAmM67kAAXBFEIDYDI7wLBtEoEIfYNwjiUGGJQYQMAjCHEAO0C4zxW29CoCgfIxR9AKA6J8BgUAIhDGMIoJ40hqgwCgKETgnBhhqCGI0AIqgZhGDANQDIlBDCRGkCoJISR0g1BSKQOgfAzBRG0DYHARh4DeDAOwANuw8ApCKKkYg/RPhjBsH0J4yg5hPGWN0GwFBHQBFaDoQIURljFAoB4GgzRVzbBECQFQRQoguHGHANwDRdCKy8CgSIGwhhoDYJYYI1giBICSAEgI=") oSurface:SetProperty("Background",70/*exCheckBoxState0*/,0x1000000) oSurface:SetProperty("Background",71/*exCheckBoxState1*/,0x2000000) oSurface:SetProperty("Background",72/*exCheckBoxState2*/,0x3000000) oElements := oSurface:Elements() var_Element := oSurface:Elements():Add("Element Check 1",-64,-64) oElements:Add("Child"):Parent := var_Element var_Element:Pictures := "1/2" var_Element:Expanded := .F. oElement := oElements:Add("Element Check 2",32,96) oElement:Checked := 1/*exChecked*/ oElement:Pictures := "1,2" oSurface:Home() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
129 |
ImageSize property on 16 (default) (specifies the size of control' icons)
PROCEDURE OnAddElement(oSurface,Element) /*Element.ShowCheckBox = True*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement,var_Element LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:AddElement := {|Element| OnAddElement(oSurface,Element)} /*A new element has been added to the surface.*/ oSurface:BeginUpdate() oSurface:ImageSize := 16 oSurface:Images("gBJJgBAIDAAEg4ACEKAD/hz/EMNh8TIRNGwAjEZAEXjAojJAjMLjABAAgjUYkUnlUrlktl0vmExmUzmk1m03nE5nU7nkrQCAntBoVDolFo1HoM/ADAplLptImdMYFOqdSqlXq1QrVbrlGpVWsFNrNdnNjsk7pQAtNroFnt0sh8Yr9iulTuNxs1Eu8OiT/vsnsNVutXlk/oGGtVKxGLxWNtsZtN8iUYuNvy0Zvd+xNYwdwvl4p870GCqc8vOeuVttmp1knyOayWVy+WzN/ze1wOElenm+12WUz/Bv2/3UyyWrzeutux2GSyGP2dQ33C1ur3GD3M4zUNzHdlWjq/E3nGzVpjWv4HA7fRy/Tv2IrN8rPW6nZ3ve7mUlfu20Z8acvQyb+vY9jasYoDwMm+LytVBDqKG3z8O3Cb8P+mkAuY9cCQ2uL4KaxDKvkp8RNLEjqugnrwQo/UWPzFyeQw5sNLZFENrI4kOqU66pw8uzmOKvTqNqjULJvGL1JO48GtT" +; "GsbLdEL3scxLlyiw8dQeoUVxdLTtyKmUjwGlslRPJsnK1HbAKbKCrsQo8uQk/CeP44iaR/ATnTNPLvyxPU+z9P9AUDQVBowiofJXQ6Oo+kKMpIkjztE4TKn4P6JowfgPnwD5/nAjB8AOeAPo0eAA1IAFH07UhAIMpYAVIYFHqBUhwVjV1S1EtQAHxW65V0AZwAeuQAnwB5gAPYViEDVhwAHTQBkCjB4gOhwDmCyhH0sACAg==") oElements := oSurface:Elements() var_Element := oSurface:Elements():Add("Element Check 1",-64,-64) oElements:Add("Child"):Parent := var_Element var_Element:Pictures := "1/2" var_Element:Expanded := .F. oElement := oElements:Add("Element Check 2",0,32) oElement:Checked := 1/*exChecked*/ oElement:Pictures := "1,2" oSurface:Home() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
128 |
We want to have option to start/end connectors at the middle of each side of the elements
|
127 |
How can I determine the position the user clicks within the element's boundaries (Click event)
PROCEDURE OnClick(oSurface) LOCAL X,Y,e e := oSurface:ElementFromPoint(-1,-1) X := -1 Y := -1 oSurface:PointToPosition(X,Y) DevOut( Transform(e,"") ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:Click := {|| OnClick(oSurface)} /*Occurs when the user presses and then releases the left mouse button over the control.*/ oSurface:BeginUpdate() oElements := oSurface:Elements() oElements:Add("Element 1") oElements:Add("Element 2",128,64) oSurface:FitToClient() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
126 |
How can I determine the position the user clicks within the element's boundaries (MouseMove event)
PROCEDURE OnMouseMove(oSurface,Button,Shift,X,Y) LOCAL e e := oSurface:ElementFromPoint(X,Y) oSurface:PointToPosition(X,Y) DevOut( Transform(e,"") ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oSurface,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oSurface:BeginUpdate() oElements := oSurface:Elements() oElements:Add("Element 1") oElements:Add("Element 2",128,64) oSurface:FitToClient() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
125 |
How can I convert the screen position (mouse) to surface position
PROCEDURE OnMouseMove(oSurface,Button,Shift,X,Y) DevOut( "Point " ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) oSurface:PointToPosition(X,Y) DevOut( "Position " ) DevOut( Transform(X,"") ) DevOut( Transform(Y,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:MouseMove := {|Button,Shift,X,Y| OnMouseMove(oSurface,Button,Shift,X,Y)} /*Occurs when the user moves the mouse.*/ oSurface:BeginUpdate() oElements := oSurface:Elements() oElements:Add("Element <sha ;;0>1") oElements:Add("Element <sha ;;0>2",164,64) oElements:Add("Element <sha ;;0>3",0,132) oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(2)) oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(1)) oSurface:FitToClient() oSurface:AxisStyle := 192/*0xc0+*/ oSurface:SetProperty("AxisColor",AutomationTranslateColor( GraMakeRGBColor ( { 128,128,128 } ) , .F. )) oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
124 |
Is is possible to show just the positive coordinates
|
123 |
Cartesian coordinates (positive coordinates are shown top-right to the origin)
|
122 |
Default coordinates (positive coordinates are shown bottom-right to the origin)
|
121 |
Is it possible to customize the path of the links orthogonally similar with Microsoft Visio tool
|
120 |
Does your control supports OLE Drag and Drop
PROCEDURE OnOLEDragDrop(oSurface,Data,Effect,Button,Shift,X,Y) DevOut( Transform(Data,"") ) RETURN PROCEDURE OnOLEStartDrag(oSurface,Data,AllowedEffects) /*Data.SetData("some data to drag")*/ RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:OLEDragDrop := {|Data,Effect,Button,Shift,X,Y| OnOLEDragDrop(oSurface,Data,Effect,Button,Shift,X,Y)} /*Occurs when a source component is dropped onto a target component when the source component determines that a drop can occur.*/ oSurface:OLEStartDrag := {|Data,AllowedEffects| OnOLEStartDrag(oSurface,Data,AllowedEffects)} /*Occurs when the OLEDrag method is called.*/ oSurface:OLEDropMode := 1/*exOLEDropManual*/ oElement := oSurface:Elements():Add("Click the Element wait for .5 second until + cursor is shown, to start <b>OLE Drag and Drop</b>") oElement:CaptionSingleLine := 0/*exCaptionWordWrap*/ oElement:AutoSize := .F. oElement:Width := 256 oElement:Height := 56 oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
119 |
Is it possible to disable customizing the path of a specified link
|
118 |
How do I let user customizes the link's path
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oSurface:AllowLinkControlPoint := -1/*0xffffff80+exAllowChangeTo+exAllowChangeFrom+exOrthoArrange+exMiddleControlPoint+exControlPoint+exEndControlPoint+exStartControlPoint*/ oElements := oSurface:Elements() oElements:Add("Element <sha ;;0>A") oElements:Add("Element <sha ;;0>B",164,64) oElements:Add("Element <sha ;;0>B",0,132) oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(2)):CustomPath := "0.5,0.25,0.5,.75" oLink := oLinks:Add(oSurface:Elements:Item(3),oSurface:Elements:Item(1)) oLink:ShowLinkType := 3/*exLinkStraight+exLinkDirect*/ oLink:StartPos := 0/*LeftAlignment*/ oSurface:Zoom := 200 oSurface:FitToClient() oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
117 |
How can I generate a picture/image/graph from my diagram
|
116 |
How can I generate a picture/image/graph from my diagram
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oPrint LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oElements := oSurface:Elements() oElements:Add("Element A"):ID := "A" oElements:Add("Element B"):ID := "B" oElements:Add("Element C"):ID := "C" oElements:Add("Element D"):ID := "D" oElements:Add("Element E"):ID := "E" oElements:Add("Element E"):ID := "F" oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C")) oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("D")) oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("C")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("E")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("F")) oSurface:SetProperty("DefArrange",4/*exDefArrangeCompact*/,.F.) oSurface:Arrange() oPrint := CreateObject("Exontrol.Print") oPrint:PrintExt := oSurface oPrint:CopyTo("c:/temp/xtest.jpg") DevOut( "!!!check the file c:/temp/xtest.jpg!!!" ) oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
115 |
How can I print the component
|
114 |
How can I show direct-links
|
113 |
How can I show straight-links
|
112 |
How can I show round-links
|
111 |
I've tried to insert a "<br>" in the Caption property text and it just ignores it
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oElements := oSurface:Elements() oElement := oElements:Add("caption") oElement:CaptionSingleLine := 0/*exCaptionWordWrap*/ oElement:Caption := "first caption<br>second caption<br>third caption" oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
110 |
How do I align the extra-caption
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElement LOCAL oElements LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oSurface:BeginUpdate() oElements := oSurface:Elements() oElement := oElements:Add("caption") oElement:AutoSize := .F. oElement:Width := 128 oElement:Height := 64 oElement:ExtraCaption := "extra-caption" oElement:ExtraCaptionAlign := 34/*exBottomRight*/ oSurface:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
109 |
How can I add an extra caption
|
108 |
I am using the reserve-neighbors feature, the question is how to shift left/right the neighbors instead of up/down
|
107 |
I am using the reserve-neighbors feature, the question is if possible to specify the distance between neighbors
|
106 |
How do I enable the reserve-neighbors feature
|
105 |
I've noticed that recently, the elements get compacted once the Arrange method is performed. How can I prevent that
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oElements := oSurface:Elements() oElements:Add("Element A"):ID := "A" oElements:Add("Element B"):ID := "B" oElements:Add("Element C"):ID := "C" oElements:Add("Element D"):ID := "D" oElements:Add("Element E"):ID := "E" oElements:Add("Element E"):ID := "F" oLinks := oSurface:Links() oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("B")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("C")) oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("D")) oLinks:Add(oSurface:Elements:Item("B"),oSurface:Elements:Item("C")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("E")) oLinks:Add(oSurface:Elements:Item("A"),oSurface:Elements:Item("F")) oSurface:SetProperty("DefArrange",4/*exDefArrangeCompact*/,.F.) oSurface:Arrange() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
104 |
Is it possible to add a link to show from bottom/down to top/up, rather that right to left (method-2)
|
103 |
Is it possible to add a link to show from bottom/down to top/up, rather that right to left (method-1)
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oElements LOCAL oLink LOCAL oLinks LOCAL oSurface oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oSurface := XbpActiveXControl():new( oForm:drawingArea ) oSurface:CLSID := "Exontrol.Surface.1" /*{AC1DF7F4-0919-4364-8167-2F9B5155EA4B}*/ oSurface:create(,, {10,60},{610,370} ) oElements := oSurface:Elements() oElements:Add("Element <sha ;;0>A") oElements:Add("Element <sha ;;0>B",48,48) oLinks := oSurface:Links() oLink := oLinks:Add(oSurface:Elements:Item(1),oSurface:Elements:Item(2)) oLink:StartPos := 4/*DownAlignment*/ oLink:EndPos := 3/*UpAlignment*/ oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |
102 |
How do I enable the cross link support ( mixed )
|
101 |
How do I enable the cross link support ( triangular )
|