For example, say that you have two drawing modes: point drawing and line drawing.
The pen down in point drawing mode would create a point at that location. A pen down
in line drawing mode would either mark the end of a line or the beginning of a line. You
can isolate these two pen down events by creating two SCMode classes and using them
with an SCWindowWithMode. Before you begin a line draw, switch the window to the
line drawing mode. Then all events will be handled appropriately. If you change to point
drawing, switch modes to point drawing. To change modes simply pass your SCMode
class to your SCWindowWithMode with this function:
void SetMode (SCMode *mode);
MathWindow
Class Name Derived From Styles Signals
MathWindow SCWindowWithMode/
CPUndoThing
FF_NONE
FF_THIN
FF_THICK
PSF_SIZED
PSF_FOCUS_RECEIVED
PSF_FOCUS_LOST
PSF_KEY_RECEIVED
MathWindow is a simple window that allows the editing or displaying of 2D math. This
window can be placed anywhere inside a PEG window class, but is normally put inside
an AbstractMathWindow object. MathWindow does not support scrolling. Instead, the
AbstractMathWindow class provides a frame in which the MathWindow can be
posititioned inside.
The following is an example that creates a MathWindow and places some 2D math
inside:
PegRect rr = {0,1,100,100};
MathWindow *m_math = new MathWindow(rr,1 ,0 ,false ,10 , 10);
m_math->SetMathObject(CPString_to_LinearMathObject("((1/2)^2)"));
AddR(m_math);
54