Page 1 of 1

GetDrawingMode() + GetFrontColor() + GetBackColor() ?

Posted: Mon Jun 03, 2013 12:10 am
by Savapo
Hello,

Please, would it be possible to add the function 'memo=GetDrawingMode()' or 'memo=DrawingMode()', to be able to store and restore the state of DrawingMode() ?

same for 'memo=GetFrontColor()' or 'memo=FrontColor()'
same for 'memo=GetBackColor()' or 'memo=BackColor()'

To simplify writing programs, without having to manipulate global variables.

Code: Select all

Procedure Plot_Slow(x.l,y.l)
  Protected MemoDrawingMode.l
  
  MemoDrawingMode=GetDrawingMode() ; <- record state DrawingMode(...)
  
  Box(x,y,1,1)
  
  DrawingMode(memoDrawingMode)     ; <- restore state DrawingMode(...)
  
EndProcedure
Or DrawingMode() without parameters

Code: Select all

Procedure Plot_Slow(x.l,y.l)
  Protected MemoDrawingMode.l
  
  MemoDrawingMode=DrawingMode() ; <- record state DrawingMode(...)
  
  Box(x,y,1,1)
  
  DrawingMode(memoDrawingMode)  ; <- restore state DrawingMode(...)
  
EndProcedure

Re: GetDrawingMode() + GetFrontColor() + GetBackColor() ?

Posted: Mon Jun 03, 2013 1:05 am
by STARGĂ…TE
+1

Or like push and pop

Code: Select all

PushDrawingMode() ; Save the old drawing mode

DrawingMode(NewMode)

PopDrawingMode() ; restore the old drawing mode
but at the moment you can define a macro like:

Code: Select all

Global CurrentDrawingMode.i

Macro GetDrawingMode()
	CurrentDrawingMode
EndMacro

Macro SetDrawingMode(Mode)
	DrawingMode(Mode) : CurrentDrawingMode = Mode
EndMacro

Re: GetDrawingMode() + GetFrontColor() + GetBackColor() ?

Posted: Mon Jun 03, 2013 4:56 am
by Demivec
Already requested in this thread.

+1 :)

Re: GetDrawingMode() + GetFrontColor() + GetBackColor() ?

Posted: Mon Jun 03, 2013 4:24 pm
by Polo
I like the idea of a push/pop drawing mode!! :)

Re: GetDrawingMode() + GetFrontColor() + GetBackColor() ?

Posted: Fri Jun 07, 2013 4:44 pm
by codeprof
+1