14 #ifndef FIGUREEDITOR_H
15 #define FIGUREEDITOR_H
20 #include <msdevstudio/MSconfig.h>
24 #if QT_VERSION < 0x040000
28 #include <QtCore/QCustomEvent>
72 #if QT_VERSION < 0x040000
89 #if QT_VERSION < 0x040000
92 const Q3CanvasItem * m_item;
99 #if QT_VERSION < 0x040000
110 #if QT_VERSION < 0x040000
113 const Q3CanvasItem *
item () const
158 #if QT_VERSION < 0x040000
161 void resizeCanvasToFit ( Q3CanvasItem * item );
165 void savePrinterSettings ();
175 void addPageMargin (
int x,
int y );
189 double maximumZ ()
const;
193 void setUnselectedVisible (
bool yes );
203 #if QT_VERSION < 0X040000
204 movePlotterWithText (
QCanvasItem * item,
float dx,
float dy );
206 movePlotterWithText ( Q3CanvasItem * item,
float dx,
float dy );
212 QPixmap * createPixmap (
const QRect & rectangle )
const;
217 QImage createImage (
const QRect & rectange )
const;
237 #if QT_VERSION < 0x040000
240 std::vector < Q3CanvasItem * > m_items;
251 #if QT_VERSION < 0x040000
254 Q3CanvasItem * m_rightItem;
262 #if QT_VERSION < 0x040000
265 Q3CanvasItem * m_preSelected;
282 #if QT_VERSION < 0x040000
289 #if QT_VERSION < 0x040000
292 std::vector < Q3CanvasItem * > m_selected_list;
312 lower_left, lower_middle, lower_right };
318 virtual void notifyObservers () = 0;
322 #if QT_VERSION < 0x040000
325 void makeVisible (
const Q3CanvasItem * item );
328 virtual void contentsMousePressEvent(
QMouseEvent*);
331 virtual void controlMousePressEvent () = 0;
338 void contentsMouseMoveEvent (
QMouseEvent *,
double aspect );
345 void whereClicked ( );
348 #if QT_VERSION < 0x040000
351 void placeGraphOnSelected ( Q3CanvasRectangle * item );
357 void setSelectedItems (
bool state );
360 QRect getSelectedBounds ()
const;
363 void clearSelectedList ();
368 #if QT_VERSION < 0x040000
369 void setCollidingSelected (
const QCanvasItem * target );
371 void setCollidingSelected (
const Q3CanvasItem * target );
376 void saveSelectedAsPixmap (
const std::string & filename );
380 void saveAreaAsPixmap (
const QRect & area,
const std::string & filename );
384 void copySelectedToClipboard ();
392 #if QT_VERSION < 0x040000
395 void removeFromItemList ( Q3CanvasItem * item );
398 #if QT_VERSION < 0x040000
401 void addToItemList ( Q3CanvasItem * item );
407 #if QT_VERSION < 0x040000
409 const char * name = 0, Qt::WFlags f = 0 );
412 const char * name = 0, Qt::WFlags f = 0 );
416 void static setAppKey (
const std::string & );
420 void showPrinterMargins (
bool on );
423 void setPrinterSettings ();
427 virtual void print ();
431 virtual void print (
const std::string & filename );
442 #if QT_VERSION < 0x040000
445 Q3CanvasItem * selectedItem ()
const;
450 #if QT_VERSION < 0x040000
458 #if QT_VERSION < 0x040000
461 Q3CanvasItem * getRightItem ();
465 void setAllSelected (
bool flag =
true );
468 void setLocked (
bool flag );
472 void setZoomMode (
bool flag );
475 bool getZoomMode ( )
const;
485 #if QT_VERSION < 0x040000
488 void placeGraph ( Q3CanvasRectangle * );
492 #if QT_VERSION < 0x040000
495 void add ( Q3CanvasItem * item );
500 #if QT_VERSION < 0x040000
503 void paste ( Q3CanvasItem * item );
510 #if QT_VERSION < 0x040000
513 void remove ( Q3CanvasItem *
item );
521 #if QT_VERSION < 0x040000
524 void hide ( Q3CanvasItem * item );
528 #if QT_VERSION < 0x040000
529 std::vector < QCanvasItem * > & getSelectedItems ();
531 std::vector < Q3CanvasItem * > & getSelectedItems ();
535 bool isSingleItemSelected ()
const;
538 #if QT_VERSION < 0x040000
541 void addSelectedItem ( Q3CanvasItem * item );
546 #if QT_VERSION < 0x040000
549 void removeSelectedItem ( Q3CanvasItem * item );
553 void setSelectedFlags ();
559 void scaleBy (
double factor );
569 void viewZoomReset ();
572 virtual void viewShowPickTable() = 0;
576 #if QT_VERSION < 0x040000
584 const QString & getAppKey ()
const;
588 const QString & getRegistry ()
const;
592 void enterEvent (
QEvent * );
596 void leaveEvent (
QEvent * );
603 #endif // FIGUREEDITOR_H
m_canvas_view ensureVisible(vv)
int m_apage_h
The actual Page height in Postscript points.
QCanvas * m_canvas
The canvas object.
m_canvas_view setSelectedItem(vv)
QCanvasItem * m_preSelected
The view item which is preselected when left mouse button down.
#define MDL_QTHIPPOPLOT_API
static QString s_registry
The QSettings Windows registry key.
static QString s_app_key
The QSettings application key for searching for setting.
QPoint m_mouse_down
The point of a mouse down, used when moving multiple plots.
QPoint m_moving_start
The starting point of a mouse drag.
static QPrinter * s_printer
The single QPrinter instance.
Location
Possible locations where on a QCanvasItem the mouse cursor was when clicked.
bool m_zoom_mode
Set to true if zoom Mode is enabled.
std::vector< QCanvasItem * > m_selected_list
The list of currently selected QCanvasItem objects.
bool m_ignore_margin
a flag set to true if the printer margins should be ignored when adding a plot to the canvas...
bool m_printer_bounds
A flag to indicate if rectangle display usable printer boundary should be displayed or not...
std::vector< QCanvasItem * > m_items
The list of view items on the canvas.
int m_upage_w
The usable Page width in Postscript points.
An Qt event class which wraps a QCanvasItem to be processed by the event.
QPoint m_zoom_start
The starting point of a mouse drag.for zoom.
int m_upage_h
The usable Page height in Postscript points.
QCanvasItem * m_rightItem
The view item which is clicked with right mouse button when contentsMousePressEvent() happens...
bool m_isMouseDown
The flag of mouse down or not, used when moving multiple plots.
Location m_whereClicked
Location where the mouse cursor clicked the object.
const QCanvasItem * item() const
Returns the wrapped object to be used for the event processing.
double m_scale_factor
The scale factor.
int m_apage_w
The actual Page width in Postscript points.
This class implements additional QCanvasView functionality.
const QCanvasItem * m_item
The wrapped object.