KiCad PCB EDA Suite
WORKSHEET_DATAITEM_BITMAP Class Reference

#include <class_worksheet_dataitem.h>

Inheritance diagram for WORKSHEET_DATAITEM_BITMAP:
WORKSHEET_DATAITEM

Public Types

enum  WS_ItemType {
  WS_TEXT, WS_SEGMENT, WS_RECT, WS_POLYPOLYGON,
  WS_BITMAP
}
 

Public Member Functions

 WORKSHEET_DATAITEM_BITMAP (BITMAP_BASE *aImage)
 
virtual bool HasEndPoint () override
 
int GetPPI () const
 
void SetPPI (int aBitmapPPI)
 adjust the PPI of the bitmap More...
 
void SetPixelScaleFactor ()
 set the pixel scale factor of the bitmap this factor depend on the application internal unit and the pixel per inch bitmap factor the pixel scale factor is the pixel size to application internal unit and should be initialized before printing or drawing the bitmap More...
 
void SetStart (double aPosx, double aPosy, enum corner_anchor aAnchor=RB_CORNER)
 
void SetEnd (double aPosx, double aPosy, enum corner_anchor aAnchor=RB_CORNER)
 
WS_ItemType GetType () const
 
int GetFlags () const
 
void SetFlags (int aMask)
 
void ClearFlags (int aMask)
 
int GetPage1Option ()
 
void SetPage1Option (int aChoice)
 Set the option for page 1. More...
 
const wxPoint GetStartPosUi (int ii=0) const
 
const wxPoint GetEndPosUi (int ii=0) const
 
const DPOINT GetStartPos (int ii=0) const
 
const DPOINT GetEndPos (int ii=0) const
 
virtual int GetPenSizeUi ()
 
void MoveTo (DPOINT aPosition)
 move item to a new position More...
 
void MoveToUi (wxPoint aPosition)
 move item to a new position More...
 
void MoveStartPointTo (DPOINT aPosition)
 move the starting point of the item to a new position More...
 
void MoveStartPointToUi (wxPoint aPosition)
 move the starting point of the item to a new position More...
 
void MoveEndPointTo (DPOINT aPosition)
 move the ending point of the item to a new position has meaning only for items defined by 2 points (segments and rectangles) More...
 
void MoveEndPointToUi (wxPoint aPosition)
 move the ending point of the item to a new position has meaning only for items defined by 2 points (segments and rectangles) More...
 
virtual bool IsInsidePage (int ii) const
 
const wxString GetClassName () const
 
bool IsSelected ()
 
void SetSelected (bool aState)
 Function SetSelected Toggles on/off the selected flag (used in edition functions. More...
 
bool UseAltColor ()
 
COLOR4D GetItemColor ()
 

Static Public Member Functions

static int GetMarkerSizeUi ()
 

Public Attributes

BITMAP_BASEm_ImageBitmap
 
wxString m_Name
 
wxString m_Info
 
POINT_COORD m_Pos
 
POINT_COORD m_End
 
double m_LineWidth
 
int m_RepeatCount
 
DPOINT m_IncrementVector
 
int m_IncrementLabel
 

Static Public Attributes

static double m_WSunits2Iu = 1.0
 
static DPOINT m_RB_Corner
 
static DPOINT m_LT_Corner
 
static double m_DefaultLineWidth = 0.0
 
static DSIZE m_DefaultTextSize
 
static double m_DefaultTextThickness = 0.0
 
static bool m_SpecialMode = false
 
static COLOR4D m_Color = COLOR4D( RED )
 
static COLOR4D m_AltColor = COLOR4D( RED )
 
static COLOR4D m_SelectedColor = COLOR4D( BROWN )
 

Protected Attributes

WS_ItemType m_type
 
int m_flags
 

Detailed Description

Definition at line 498 of file class_worksheet_dataitem.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

WORKSHEET_DATAITEM_BITMAP::WORKSHEET_DATAITEM_BITMAP ( BITMAP_BASE aImage)
inline

Definition at line 504 of file class_worksheet_dataitem.h.

Member Function Documentation

void WORKSHEET_DATAITEM::ClearFlags ( int  aMask)
inlineinherited
const wxString WORKSHEET_DATAITEM::GetClassName ( ) const
inherited

Definition at line 326 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetType(), name, WORKSHEET_DATAITEM::WS_BITMAP, WORKSHEET_DATAITEM::WS_POLYPOLYGON, WORKSHEET_DATAITEM::WS_RECT, WORKSHEET_DATAITEM::WS_SEGMENT, and WORKSHEET_DATAITEM::WS_TEXT.

Referenced by PROPERTIES_FRAME::CopyPrmsFromItemToPanel(), and PL_EDITOR_FRAME::RebuildDesignTree().

327 {
328  wxString name;
329 
330  switch( GetType() )
331  {
332  case WS_TEXT: name = wxT( "Text" ); break;
333  case WS_SEGMENT: name = wxT( "Line" ); break;
334  case WS_RECT: name = wxT( "Rect" ); break;
335  case WS_POLYPOLYGON: name = wxT( "Poly" ); break;
336  case WS_BITMAP: name = wxT( "Bitmap" ); break;
337  }
338 
339  return name;
340 }
WS_ItemType GetType() const
const char * name
const DPOINT WORKSHEET_DATAITEM::GetEndPos ( int  ii = 0) const
inherited

Definition at line 268 of file class_worksheet_dataitem.cpp.

References LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM::m_End, WORKSHEET_DATAITEM::m_IncrementVector, WORKSHEET_DATAITEM::m_LT_Corner, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_RB_Corner, RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by WORKSHEET_DATAITEM::GetEndPosUi(), WORKSHEET_DATAITEM::IsInsidePage(), PL_EDITOR_FRAME::MoveItem(), WORKSHEET_DATAITEM::MoveTo(), and PL_EDITOR_FRAME::PlaceItem().

269 {
270  DPOINT pos;
271  pos.x = m_End.m_Pos.x + ( m_IncrementVector.x * ii );
272  pos.y = m_End.m_Pos.y + ( m_IncrementVector.y * ii );
273 
274  switch( m_End.m_Anchor )
275  {
276  case RB_CORNER: // right bottom corner
277  pos = m_RB_Corner - pos;
278  break;
279 
280  case RT_CORNER: // right top corner
281  pos.x = m_RB_Corner.x - pos.x;
282  pos.y = m_LT_Corner.y + pos.y;
283  break;
284 
285  case LB_CORNER: // left bottom corner
286  pos.x = m_LT_Corner.x + pos.x;
287  pos.y = m_RB_Corner.y - pos.y;
288  break;
289 
290  case LT_CORNER: // left top corner
291  pos = m_LT_Corner + pos;
292  break;
293  }
294 
295  return pos;
296 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
const wxPoint WORKSHEET_DATAITEM::GetEndPosUi ( int  ii = 0) const
inherited

Definition at line 299 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetEndPos(), KiROUND(), WORKSHEET_DATAITEM::m_WSunits2Iu, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), moveItem(), and PL_EDITOR_FRAME::MoveItem().

300 {
301  DPOINT pos = GetEndPos( ii );
302  pos = pos * m_WSunits2Iu;
303  return wxPoint( KiROUND( pos.x ), KiROUND( pos.y ) );
304 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
const DPOINT GetEndPos(int ii=0) const
int WORKSHEET_DATAITEM::GetFlags ( ) const
inlineinherited
COLOR4D WORKSHEET_DATAITEM::GetItemColor ( )
inlineinherited
static int WORKSHEET_DATAITEM::GetMarkerSizeUi ( )
inlinestaticinherited

Definition at line 208 of file class_worksheet_dataitem.h.

References KiROUND().

Referenced by WS_DRAW_ITEM_LIST::Draw(), WS_DRAW_ITEM_LINE::HitTestEndPoint(), WS_DRAW_ITEM_RECT::HitTestEndPoint(), WS_DRAW_ITEM_LINE::HitTestStartPoint(), WS_DRAW_ITEM_POLYGON::HitTestStartPoint(), WS_DRAW_ITEM_RECT::HitTestStartPoint(), WS_DRAW_ITEM_TEXT::HitTestStartPoint(), and WS_DRAW_ITEM_BITMAP::HitTestStartPoint().

209  {
210  return KiROUND( 0.5 * m_WSunits2Iu );
211  }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
int WORKSHEET_DATAITEM::GetPage1Option ( )
inherited
Returns
0 if the item has no specific option for page 1 1 if the item is only on page 1 -1 if the item is not on page 1

Definition at line 347 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::m_flags, PAGE1OPTION, PAGE1OPTION_NOTONPAGE1, and PAGE1OPTION_PAGE1ONLY.

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), PROPERTIES_FRAME::CopyPrmsFromItemToPanel(), and WORKSHEET_LAYOUT_IO::formatOptions().

348 {
350  return -1;
351 
352  if(( m_flags & PAGE1OPTION) == PAGE1OPTION_PAGE1ONLY )
353  return 1;
354 
355  return 0;
356 }
#define PAGE1OPTION_NOTONPAGE1
#define PAGE1OPTION_PAGE1ONLY
#define PAGE1OPTION
virtual int WORKSHEET_DATAITEM::GetPenSizeUi ( )
inlinevirtualinherited

Reimplemented in WORKSHEET_DATAITEM_TEXT, and WORKSHEET_DATAITEM_POLYPOLYGON.

Definition at line 200 of file class_worksheet_dataitem.h.

References KiROUND().

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList().

201  {
202  if( m_LineWidth )
203  return KiROUND( m_LineWidth * m_WSunits2Iu );
204  else
206  }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
int WORKSHEET_DATAITEM_BITMAP::GetPPI ( ) const
Returns
the PPI of the bitmap

Definition at line 594 of file class_worksheet_dataitem.cpp.

References BITMAP_BASE::GetPPI(), BITMAP_BASE::GetScale(), and m_ImageBitmap.

Referenced by PROPERTIES_FRAME::CopyPrmsFromItemToPanel().

595 {
596  if( m_ImageBitmap )
598 
599  return 300;
600 }
double GetScale() const
int GetPPI() const
const DPOINT WORKSHEET_DATAITEM::GetStartPos ( int  ii = 0) const
inherited

Definition at line 229 of file class_worksheet_dataitem.cpp.

References LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM::m_IncrementVector, WORKSHEET_DATAITEM::m_LT_Corner, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_Pos, WORKSHEET_DATAITEM::m_RB_Corner, RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by WORKSHEET_DATAITEM_POLYPOLYGON::GetCornerPosition(), WORKSHEET_DATAITEM::GetStartPosUi(), WORKSHEET_DATAITEM::IsInsidePage(), WORKSHEET_DATAITEM_POLYPOLYGON::IsInsidePage(), PL_EDITOR_FRAME::MoveItem(), WORKSHEET_DATAITEM::MoveTo(), and PL_EDITOR_FRAME::PlaceItem().

230 {
231  DPOINT pos;
232  pos.x = m_Pos.m_Pos.x + ( m_IncrementVector.x * ii );
233  pos.y = m_Pos.m_Pos.y + ( m_IncrementVector.y * ii );
234 
235  switch( m_Pos.m_Anchor )
236  {
237  case RB_CORNER: // right bottom corner
238  pos = m_RB_Corner - pos;
239  break;
240 
241  case RT_CORNER: // right top corner
242  pos.x = m_RB_Corner.x - pos.x;
243  pos.y = m_LT_Corner.y + pos.y;
244  break;
245 
246  case LB_CORNER: // left bottom corner
247  pos.x = m_LT_Corner.x + pos.x;
248  pos.y = m_RB_Corner.y - pos.y;
249  break;
250 
251  case LT_CORNER: // left top corner
252  pos = m_LT_Corner + pos;
253  break;
254  }
255 
256  return pos;
257 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
const wxPoint WORKSHEET_DATAITEM::GetStartPosUi ( int  ii = 0) const
inherited

Definition at line 260 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetStartPos(), KiROUND(), WORKSHEET_DATAITEM::m_WSunits2Iu, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList(), EVT_MENU_RANGE(), moveItem(), PL_EDITOR_FRAME::MoveItem(), and PL_EDITOR_FRAME::UpdateStatusBar().

261 {
262  DPOINT pos = GetStartPos( ii );
263  pos = pos * m_WSunits2Iu;
264  return wxPoint( KiROUND( pos.x ), KiROUND( pos.y ) );
265 }
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
const DPOINT GetStartPos(int ii=0) const
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
virtual bool WORKSHEET_DATAITEM_BITMAP::HasEndPoint ( )
inlineoverridevirtual
Returns
false (no end point)

Reimplemented from WORKSHEET_DATAITEM.

Definition at line 513 of file class_worksheet_dataitem.h.

513 { return false; }
bool WORKSHEET_DATAITEM::IsInsidePage ( int  ii) const
virtualinherited
Returns
true if the item is inside the rectangle defined by the 4 corners, false otherwise.

Reimplemented in WORKSHEET_DATAITEM_POLYPOLYGON.

Definition at line 307 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetEndPos(), WORKSHEET_DATAITEM::GetStartPos(), WORKSHEET_DATAITEM::m_LT_Corner, WORKSHEET_DATAITEM::m_RB_Corner, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by WS_DRAW_ITEM_LIST::BuildWorkSheetGraphicList().

308 {
309  DPOINT pos = GetStartPos( ii );
310 
311  for( int kk = 0; kk < 1; kk++ )
312  {
313  if( m_RB_Corner.x < pos.x || m_LT_Corner.x > pos.x )
314  return false;
315 
316  if( m_RB_Corner.y < pos.y || m_LT_Corner.y > pos.y )
317  return false;
318 
319  pos = GetEndPos( ii );
320  }
321 
322  return true;
323 }
const DPOINT GetStartPos(int ii=0) const
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
const DPOINT GetEndPos(int ii=0) const
bool WORKSHEET_DATAITEM::IsSelected ( )
inlineinherited
Returns
true if the selected state on ON

Definition at line 265 of file class_worksheet_dataitem.h.

References SELECTED_STATE.

Referenced by WORKSHEET_DATAITEM::GetItemColor().

265 { return (m_flags & SELECTED_STATE) != 0; }
#define SELECTED_STATE
void WORKSHEET_DATAITEM::MoveEndPointTo ( DPOINT  aPosition)
inherited

move the ending point of the item to a new position has meaning only for items defined by 2 points (segments and rectangles)

move the ending point of the item to a new position has meaning only for items defined by 2 points (segments and rectangles) aPosition = the new position of the ending point, in mm

Parameters
aPosition= the new position of the ending point, in mm

Definition at line 172 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetType(), LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM::m_End, WORKSHEET_DATAITEM::m_LT_Corner, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_RB_Corner, RB_CORNER, RT_CORNER, WORKSHEET_DATAITEM::WS_RECT, WORKSHEET_DATAITEM::WS_SEGMENT, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by abortMoveItem(), WORKSHEET_DATAITEM::MoveEndPointToUi(), WORKSHEET_DATAITEM::MoveTo(), and PL_EDITOR_FRAME::PlaceItem().

173 {
174  DPOINT position;
175 
176  // Calculate the position of the starting point
177  // relative to the reference corner
178  // aPosition is the position relative to the right top paper corner
179  switch( m_End.m_Anchor )
180  {
181  case RB_CORNER:
182  position = m_RB_Corner - aPosition;
183  break;
184 
185  case RT_CORNER:
186  position.x = m_RB_Corner.x - aPosition.x;
187  position.y = aPosition.y - m_LT_Corner.y;
188  break;
189 
190  case LB_CORNER:
191  position.x = aPosition.x - m_LT_Corner.x;
192  position.y = m_RB_Corner.y - aPosition.y;
193  break;
194 
195  case LT_CORNER:
196  position = aPosition - m_LT_Corner;
197  break;
198  }
199 
200  // Modify m_End only for items having 2 coordinates
201  switch( GetType() )
202  {
203  case WS_SEGMENT:
204  case WS_RECT:
205  m_End.m_Pos = position;
206  break;
207 
208  default:
209  break;
210  }
211 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
WS_ItemType GetType() const
void WORKSHEET_DATAITEM::MoveEndPointToUi ( wxPoint  aPosition)
inherited

move the ending point of the item to a new position has meaning only for items defined by 2 points (segments and rectangles)

Parameters
aPosition= the new position of the ending point in graphic units

Definition at line 219 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::m_WSunits2Iu, WORKSHEET_DATAITEM::MoveEndPointTo(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

Referenced by moveItem().

220 {
221  DPOINT pos_mm;
222  pos_mm.x = aPosition.x / m_WSunits2Iu;
223  pos_mm.y = aPosition.y / m_WSunits2Iu;
224 
225  MoveEndPointTo( pos_mm );
226 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void MoveEndPointTo(DPOINT aPosition)
move the ending point of the item to a new position has meaning only for items defined by 2 points (s...
void WORKSHEET_DATAITEM::MoveStartPointTo ( DPOINT  aPosition)
inherited

move the starting point of the item to a new position

Parameters
aPosition= the new position of the starting point, in mm

Definition at line 121 of file class_worksheet_dataitem.cpp.

References LB_CORNER, LT_CORNER, POINT_COORD::m_Anchor, WORKSHEET_DATAITEM::m_LT_Corner, POINT_COORD::m_Pos, WORKSHEET_DATAITEM::m_Pos, WORKSHEET_DATAITEM::m_RB_Corner, RB_CORNER, RT_CORNER, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by abortMoveItem(), WORKSHEET_DATAITEM::MoveStartPointToUi(), WORKSHEET_DATAITEM::MoveTo(), and PL_EDITOR_FRAME::PlaceItem().

122 {
123  DPOINT position;
124 
125  // Calculate the position of the starting point
126  // relative to the reference corner
127  // aPosition is the position relative to the right top paper corner
128  switch( m_Pos.m_Anchor )
129  {
130  case RB_CORNER:
131  position = m_RB_Corner - aPosition;
132  break;
133 
134  case RT_CORNER:
135  position.x = m_RB_Corner.x - aPosition.x;
136  position.y = aPosition.y - m_LT_Corner.y;
137  break;
138 
139  case LB_CORNER:
140  position.x = aPosition.x - m_LT_Corner.x;
141  position.y = m_RB_Corner.y - aPosition.y;
142  break;
143 
144  case LT_CORNER:
145  position = aPosition - m_LT_Corner;
146  break;
147  }
148 
149  m_Pos.m_Pos = position;
150 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void WORKSHEET_DATAITEM::MoveStartPointToUi ( wxPoint  aPosition)
inherited

move the starting point of the item to a new position

Parameters
aPosition= the new position of item in graphic units

Definition at line 156 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::m_WSunits2Iu, WORKSHEET_DATAITEM::MoveStartPointTo(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

Referenced by moveItem().

157 {
158  DPOINT pos_mm;
159  pos_mm.x = aPosition.x / m_WSunits2Iu;
160  pos_mm.y = aPosition.y / m_WSunits2Iu;
161 
162  MoveStartPointTo( pos_mm );
163 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void MoveStartPointTo(DPOINT aPosition)
move the starting point of the item to a new position
void WORKSHEET_DATAITEM::MoveTo ( DPOINT  aPosition)
inherited

move item to a new position

Parameters
aPosition= the new position of item, in mm

Definition at line 108 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::GetEndPos(), WORKSHEET_DATAITEM::GetStartPos(), WORKSHEET_DATAITEM::MoveEndPointTo(), and WORKSHEET_DATAITEM::MoveStartPointTo().

Referenced by abortMoveItem(), WORKSHEET_DATAITEM::MoveToUi(), and PL_EDITOR_FRAME::PlaceItem().

109 {
110  DPOINT vector = aPosition - GetStartPos();
111  DPOINT endpos = vector + GetEndPos();
112 
113  MoveStartPointTo( aPosition );
114  MoveEndPointTo( endpos );
115 }
const DPOINT GetStartPos(int ii=0) const
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void MoveEndPointTo(DPOINT aPosition)
move the ending point of the item to a new position has meaning only for items defined by 2 points (s...
void MoveStartPointTo(DPOINT aPosition)
move the starting point of the item to a new position
const DPOINT GetEndPos(int ii=0) const
void WORKSHEET_DATAITEM::MoveToUi ( wxPoint  aPosition)
inherited

move item to a new position

Parameters
aPosition= the new position of the starting point in graphic units

Definition at line 98 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::m_WSunits2Iu, WORKSHEET_DATAITEM::MoveTo(), wxPoint::x, VECTOR2< T >::x, wxPoint::y, and VECTOR2< T >::y.

Referenced by moveItem().

99 {
100  DPOINT pos_mm;
101  pos_mm.x = aPosition.x / m_WSunits2Iu;
102  pos_mm.y = aPosition.y / m_WSunits2Iu;
103 
104  MoveTo( pos_mm );
105 }
Class VECTOR2 defines a general 2D-vector/point.
Definition: vector2d.h:61
void MoveTo(DPOINT aPosition)
move item to a new position
void WORKSHEET_DATAITEM::SetEnd ( double  aPosx,
double  aPosy,
enum corner_anchor  aAnchor = RB_CORNER 
)
inlineinherited

Definition at line 161 of file class_worksheet_dataitem.h.

References POINT_COORD::m_Anchor, POINT_COORD::m_Pos, VECTOR2< T >::x, and VECTOR2< T >::y.

162  {
163  m_End.m_Pos.x = aPosx;
164  m_End.m_Pos.y = aPosy;
165  m_End.m_Anchor = aAnchor;
166  }
void WORKSHEET_DATAITEM::SetFlags ( int  aMask)
inlineinherited
void WORKSHEET_DATAITEM::SetPage1Option ( int  aChoice)
inherited

Set the option for page 1.

Parameters
aChoice= 0 if the item has no specific option for page 1

0 if the item is only on page 1

< 0 if the item is not on page 1

Definition at line 364 of file class_worksheet_dataitem.cpp.

References WORKSHEET_DATAITEM::ClearFlags(), PAGE1OPTION, PAGE1OPTION_NOTONPAGE1, PAGE1OPTION_PAGE1ONLY, and WORKSHEET_DATAITEM::SetFlags().

Referenced by PROPERTIES_FRAME::CopyPrmsFromPanelToItem(), and PAGE_LAYOUT_READER_PARSER::readOption().

365 {
367 
368  if( aChoice > 0 )
370 
371  else if( aChoice < 0 )
373 
374 }
#define PAGE1OPTION_NOTONPAGE1
#define PAGE1OPTION_PAGE1ONLY
#define PAGE1OPTION
void WORKSHEET_DATAITEM_BITMAP::SetPixelScaleFactor ( )

set the pixel scale factor of the bitmap this factor depend on the application internal unit and the pixel per inch bitmap factor the pixel scale factor is the pixel size to application internal unit and should be initialized before printing or drawing the bitmap

Definition at line 579 of file class_worksheet_dataitem.cpp.

References BITMAP_BASE::GetPPI(), m_ImageBitmap, WORKSHEET_DATAITEM::m_WSunits2Iu, scale, and BITMAP_BASE::SetPixelScaleFactor().

580 {
581  if( m_ImageBitmap )
582  {
583  // m_WSunits2Iu is the page layout unit to application internal unit
584  // i.e. the mm to to application internal unit
585  // however the bitmap definition is always known in pixels per inches
586  double scale = m_WSunits2Iu * 25.4 / m_ImageBitmap->GetPPI();
588  }
589 }
void SetPixelScaleFactor(double aSF)
const int scale
int GetPPI() const
void WORKSHEET_DATAITEM_BITMAP::SetPPI ( int  aBitmapPPI)

adjust the PPI of the bitmap

Parameters
aBitmapPPI= the ned PPI for the bitmap

Definition at line 605 of file class_worksheet_dataitem.cpp.

References BITMAP_BASE::GetPPI(), m_ImageBitmap, and BITMAP_BASE::SetScale().

Referenced by PROPERTIES_FRAME::CopyPrmsFromPanelToItem().

606 {
607  if( m_ImageBitmap )
608  m_ImageBitmap->SetScale( (double) m_ImageBitmap->GetPPI() / aBitmapPPI );
609 }
void SetScale(double aScale)
int GetPPI() const
void WORKSHEET_DATAITEM::SetSelected ( bool  aState)
inlineinherited

Function SetSelected Toggles on/off the selected flag (used in edition functions.

Parameters
aState= the flag value

Definition at line 272 of file class_worksheet_dataitem.h.

References SELECTED_STATE.

Referenced by PL_EDITOR_FRAME::RedrawActiveWindow().

273  {
274  if( aState )
276  else
278  }
#define SELECTED_STATE
void WORKSHEET_DATAITEM::SetStart ( double  aPosx,
double  aPosy,
enum corner_anchor  aAnchor = RB_CORNER 
)
inlineinherited

Definition at line 154 of file class_worksheet_dataitem.h.

References POINT_COORD::m_Anchor, POINT_COORD::m_Pos, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PL_EDITOR_FRAME::UpdateStatusBar().

155  {
156  m_Pos.m_Pos.x = aPosx;
157  m_Pos.m_Pos.y = aPosy;
158  m_Pos.m_Anchor = aAnchor;
159  }
bool WORKSHEET_DATAITEM::UseAltColor ( )
inlineinherited

Definition at line 280 of file class_worksheet_dataitem.h.

References USE_ALT_COLOR.

Referenced by WORKSHEET_DATAITEM::GetItemColor().

Member Data Documentation

COLOR4D WORKSHEET_DATAITEM::m_AltColor = COLOR4D( RED )
staticinherited
COLOR4D WORKSHEET_DATAITEM::m_Color = COLOR4D( RED )
staticinherited
COLOR4D WORKSHEET_DATAITEM::m_SelectedColor = COLOR4D( BROWN )
staticinherited
WS_ItemType WORKSHEET_DATAITEM::m_type
protectedinherited

The documentation for this class was generated from the following files: