mBarRange Class Reference

#include <mBarRange.h>

List of all members.

Public Member Functions

 mBarRange (wxWindow *parent, int w, int h)
 ~mBarRange ()
void Refresh (bool eraseBackground=true, const wxRect *rect=NULL)
void OnPaint (wxPaintEvent &WXUNUSED(event))
void OnSize (wxSizeEvent &WXUNUSED(event))
void RefreshHorizontalView ()
void RefreshVerticalView ()
void RefreshForce ()
void OnMouseMove (wxMouseEvent &event)
void DrawBar ()
int GetPixelActual ()
void SetPixelActual (int i)
int GetPixelStart ()
void SetPixelStart (int i)
int GetPixelEnd ()
void SetPixelEnd (int i)
double GetMax ()
void SetMax (double i)
double GetMin ()
void SetMin (double i)
int GetHeight ()
void SetHeight (int h)
int GetWidth ()
void SetWidth (int w)
int GetStart ()
void SetStart (int start)
int GetEnd ()
void SetEnd (int end)
int GetActual ()
void SetActual (int actual)
int GetTrianglesHalfWidth ()
void SetTrianglesHalfWidth (int nwTriHalfWidth)
bool GetOrientation ()
void SetOrientation (bool orientation)
bool GetInRangeProperty ()
void SetInRangeProperty (bool in)
bool IsActualInRange ()
void setVisibleLabels (bool setVisible)
bool getIfVisibleLabels ()
void setRepresentedValues (double minRealValue, double maxRealValue)
void setDeviceBlitStart (wxCoord deviceStart_x, wxCoord deviceStart_y)
void setActiveStateTo (bool activeNow)
bool isActive ()
int getRealX_vertical_line ()
void setRealX_vertical_line (int newReal_x)
void onShowPopupMenu (wxMouseEvent &event)
void onChangePartColor (wxCommandEvent &anEvent)
void onEnableRange_Actual (wxCommandEvent &anEvent)
void onMovable_ActualWithBar (wxCommandEvent &anEvent)
int getDeviceEndX ()
void setDeviceEndMargin (int newDeviceEnd_pixels)
int getClickedX ()
void setClickedX (int nwClickX)
float getStartShowPorcentage ()
float getEndShowPorcentage ()
float getActualShowPorcentage ()
int getLogicValueofPixel (int thePixel)
void setIfWithActualDrawed (bool drawActual)
bool getIfWithActualDrawed ()
void createAndSendEvent (WXTYPE theEventType)
void setBackgroundColor (wxColour theColor)
void setGuideLineColour (wxColour theNwGuideLineColor)
wxColour getGuideLineColour ()
void onLeftClicDown (wxMouseEvent &event)
void onLeftClickUp (wxMouseEvent &event)

Private Attributes

int _w
int _h
int _actual
int _start
int _end
double _max
double _min
int _initialPoint
int _selectionMoveId
bool _orientation
bool _in_rangeProperty
bool _moveActualWithBar
bool _visibleLables
wxCoord deviceStart_x
wxCoord deviceStart_y
wxCoord deviceEndMargin
bool activeState
bool withActualDrawed
wxColour start_Colour
wxColour actual_Colour
wxColour end_Colour
wxColour bar_Colour
int realX_vertical_line
int clickedX
int numberOrientation
int logicInitial_start
int logicInitial_end
int logicInitial_actual
int trianglesHalfWidth
wxColour backgroundColor
wxColour guideLineColor
bool acceptedClick
wxMenu b_popmenu
wxBitmap * _bitmap_bar
wxBitmap * _bitmap_info

Detailed Description

Definition at line 57 of file mBarRange.h.


Constructor & Destructor Documentation

mBarRange::mBarRange ( wxWindow *  parent,
int  w,
int  h 
)

Definition at line 43 of file mBarRange.cxx.

00044 :wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL)
00045 {
00046         acceptedClick = true;
00047         _bitmap_bar                     =       NULL;
00048         SetWidth (w);
00049         SetHeight(h);
00050         _initialPoint           =       0;
00051         trianglesHalfWidth = 5;
00052         
00053         wxColour start_Colour;
00054 
00055         // Setting the default parts colors
00056         start_Colour            =       wxColour(0,0,255);
00057         actual_Colour           =       wxColour(255,255,202);
00058         end_Colour                      =       wxColour(0,0,255);
00059         bar_Colour                      =       wxColour(255,0,255);
00060         backgroundColor     =   parent ->GetBackgroundColour();
00061         guideLineColor          =   wxColour(255,0,0);
00062 
00063         //actual is in _start and end
00064         //false means that it could be anywhere
00065         _moveActualWithBar      =       false;
00066         _in_rangeProperty       =       false;
00067         _selectionMoveId        =       -1;
00068         realX_vertical_line =   -1;
00069         activeState                     =       false;
00070         _actual=0;
00071         deviceEndMargin = 0;
00072 
00073         SetOrientation(true);
00074         setIfWithActualDrawed(true);
00075 
00076         b_popmenu.Append (cntID_CHANGE_COLOR, _("Change Color"), _("Changes the color of the selected part"));
00077         b_popmenu.Append (cntID_ENABLE_ACTUAL, _("Enable actual in range"), _("Enables/Disables the actual triangle to be or not in range"));
00078         b_popmenu.Append (cntID_MOVABLE_ACTUAL_BAR, _("Move actual-bar simultaneously"), _("Disables the actual triangle to move with the bar"));
00079 
00080         SetSize(w,h);
00081 }

mBarRange::~mBarRange (  ) 

Definition at line 87 of file mBarRange.cxx.

00088 {
00089 }


Member Function Documentation

void mBarRange::createAndSendEvent ( WXTYPE  theEventType  ) 

Definition at line 1361 of file mBarRange.cxx.

Referenced by OnMouseMove().

01362         {
01363                 wxCommandEvent cevent( theEventType, GetId() );
01364                 cevent.SetEventObject( this );
01365                 GetEventHandler()->ProcessEvent( cevent );
01366         }

Here is the caller graph for this function:

void mBarRange::DrawBar (  ) 

Definition at line 93 of file mBarRange.cxx.

References _bitmap_bar, _bitmap_info, _h, _orientation, _w, and deviceStart_y.

Referenced by setDeviceBlitStart().

00094 {
00095         //Horizontal
00096         if(_orientation)
00097         {
00098                 SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
00099                 _bitmap_bar             = new wxBitmap(_w+1280,_h+100);
00100                 //SIL//_bitmap_info     = new wxBitmap(_w+100+1280, _h+100);
00101         }
00102         //vertical
00103         else
00104         {
00105                 SetWindowStyle(wxNO_FULL_REPAINT_ON_RESIZE);
00106                 _bitmap_bar = new wxBitmap(_h+deviceStart_y+100,_w+1280);
00107                 _bitmap_info = new wxBitmap(_h+deviceStart_y+100, _w+1280);
00108         }
00109 }

Here is the caller graph for this function:

int mBarRange::GetActual (  ) 
float mBarRange::getActualShowPorcentage (  ) 

Definition at line 1322 of file mBarRange.cxx.

References _actual, _max, and _min.

Referenced by pPlotter::getActualShowedPorcentage().

01323         {
01324                 return (float) (1+(_actual - _max)/(_max-_min));
01325         }

Here is the caller graph for this function:

int mBarRange::getClickedX (  ) 

Definition at line 1285 of file mBarRange.cxx.

References clickedX.

Referenced by onShowPopupMenu().

01286         {
01287                 return clickedX;
01288         }

Here is the caller graph for this function:

int mBarRange::getDeviceEndX (  ) 

Definition at line 1267 of file mBarRange.cxx.

References deviceEndMargin.

01268         {
01269                 return deviceEndMargin;
01270         }

int mBarRange::GetEnd (  ) 
float mBarRange::getEndShowPorcentage (  ) 

Definition at line 1313 of file mBarRange.cxx.

References _end, _max, and _min.

Referenced by pPlotter::getMaxShowedPorcentage(), pPlotter::onEndChange_Bar(), pPlotter::onMovedBar(), and pPlotter::onStartChange_Bar().

01314         {
01315                 return (float) (1+(_end - _max)/(_max-_min));
01316         }

Here is the caller graph for this function:

wxColour mBarRange::getGuideLineColour (  ) 

Definition at line 1390 of file mBarRange.cxx.

References guideLineColor.

01391         {
01392                 return guideLineColor;
01393         }

int mBarRange::GetHeight (  ) 

Definition at line 237 of file mBarRange.cxx.

References _h.

00238 {
00239         return _h;
00240 }

bool mBarRange::getIfVisibleLabels (  ) 

Definition at line 1076 of file mBarRange.cxx.

References _visibleLables.

01077         {
01078                 return _visibleLables;
01079         }

bool mBarRange::getIfWithActualDrawed (  ) 

Definition at line 1356 of file mBarRange.cxx.

References withActualDrawed.

01357         {
01358                 return withActualDrawed;
01359         }

bool mBarRange::GetInRangeProperty (  ) 

Definition at line 116 of file mBarRange.cxx.

References _in_rangeProperty.

00117 {
00118         return _in_rangeProperty;
00119 }

int mBarRange::getLogicValueofPixel ( int  thePixel  ) 

Definition at line 1327 of file mBarRange.cxx.

References _max, _min, _w, deviceEndMargin, and deviceStart_x.

Referenced by OnMouseMove().

01328         {
01329                 return _min+((thePixel - deviceStart_x)*( _max - _min))/(_w-deviceEndMargin);
01330         }

Here is the caller graph for this function:

double mBarRange::GetMax (  ) 

Definition at line 198 of file mBarRange.cxx.

References _max.

Referenced by RefreshHorizontalView(), and RefreshVerticalView().

00199 {
00200         return _max;
00201 }

Here is the caller graph for this function:

double mBarRange::GetMin (  ) 

Definition at line 212 of file mBarRange.cxx.

References _min.

Referenced by RefreshHorizontalView(), and RefreshVerticalView().

00213 {
00214         return _min;
00215 }

Here is the caller graph for this function:

bool mBarRange::GetOrientation (  ) 

Definition at line 136 of file mBarRange.cxx.

References _orientation.

00137 {
00138         return _orientation;
00139 }

int mBarRange::GetPixelActual (  ) 

Definition at line 169 of file mBarRange.cxx.

References _actual, _max, _min, _w, and deviceEndMargin.

Referenced by OnMouseMove(), onShowPopupMenu(), RefreshHorizontalView(), and RefreshVerticalView().

00170 {
00171         return ((_actual - _min)*(_w-deviceEndMargin))/(_max - _min);
00172 }

Here is the caller graph for this function:

int mBarRange::GetPixelEnd (  ) 

Definition at line 183 of file mBarRange.cxx.

References _end, _max, _min, _w, and deviceEndMargin.

Referenced by OnMouseMove(), onShowPopupMenu(), RefreshHorizontalView(), RefreshVerticalView(), and setDeviceBlitStart().

00184 {
00185         return ((_end - _min)*(_w-deviceEndMargin))/(_max - _min);
00186 }

Here is the caller graph for this function:

int mBarRange::GetPixelStart (  ) 

Definition at line 154 of file mBarRange.cxx.

References _max, _min, _start, _w, and deviceEndMargin.

Referenced by OnMouseMove(), onShowPopupMenu(), RefreshHorizontalView(), and RefreshVerticalView().

00155 {
00156         return ((_start - _min)*(_w-deviceEndMargin))/(_max - _min);    
00157 }

Here is the caller graph for this function:

int mBarRange::getRealX_vertical_line (  ) 

Definition at line 1249 of file mBarRange.cxx.

References realX_vertical_line.

Referenced by pPlotter::onColorBar().

01250         {
01251                 return realX_vertical_line;
01252         }

Here is the caller graph for this function:

int mBarRange::GetStart (  ) 
float mBarRange::getStartShowPorcentage (  ) 

Definition at line 1304 of file mBarRange.cxx.

References _max, _min, and _start.

Referenced by pPlotter::getMinShowedPorcentage(), pPlotter::onEndChange_Bar(), pPlotter::onMovedBar(), and pPlotter::onStartChange_Bar().

01305         {
01306                 return (float)( 1+(_start - _max)/(_max-_min));
01307         }

Here is the caller graph for this function:

int mBarRange::GetTrianglesHalfWidth (  ) 

Definition at line 306 of file mBarRange.cxx.

References trianglesHalfWidth.

00307 {
00308         return trianglesHalfWidth;
00309 }

int mBarRange::GetWidth (  ) 

Definition at line 227 of file mBarRange.cxx.

References _w.

00228 {
00229         return _w;
00230 }

bool mBarRange::isActive (  ) 

Definition at line 1240 of file mBarRange.cxx.

References activeState.

Referenced by pPlotter::onChangeFunction().

01241         {
01242                 return activeState;
01243         }

Here is the caller graph for this function:

bool mBarRange::IsActualInRange (  ) 

Definition at line 128 of file mBarRange.cxx.

References _start.

Referenced by onEnableRange_Actual(), and onMovable_ActualWithBar().

00129 {
00130         return ( _actual <= _end && _actual >= _start );
00131 }

Here is the caller graph for this function:

void mBarRange::onChangePartColor ( wxCommandEvent &  anEvent  ) 

Reacts to the cntID_CHANGE_COLOR wxCommandEvent and adds a color degrade point to the color bar. param & anEvent The wxCommandEvent actioned event

Reacts to the cntID_ADD_COLOR_POINT wxCommandEvent and adds a color degrade point to the color bar. param & anEvent The wxCommandEvent actioned event

Definition at line 1157 of file mBarRange.cxx.

References _selectionMoveId, actual_Colour, bar_Colour, end_Colour, RefreshForce(), and start_Colour.

01158         {
01159                 bool okSelectedColor = false;
01160                 wxColour selectedColour;
01161                 wxColourData data;
01162                 wxColourDialog dialog( GetParent(), &data);
01163 
01164                 if ( dialog.ShowModal() == wxID_OK )
01165                 {
01166                         selectedColour = dialog.GetColourData().GetColour();
01167                         okSelectedColor = true;
01168                 }
01169                 if( okSelectedColor )
01170                 {
01171                         if (_selectionMoveId==1 )
01172                                 start_Colour = selectedColour;
01173                         else if (_selectionMoveId==2 )
01174                                 end_Colour = selectedColour;
01175                         else if( _selectionMoveId==3 )
01176                                 actual_Colour = selectedColour;
01177                         else if( _selectionMoveId==4 )
01178                                 bar_Colour = selectedColour;            
01179                 }
01180                 _selectionMoveId = -1;
01181         RefreshForce();
01182                 
01183         }

Here is the call graph for this function:

void mBarRange::onEnableRange_Actual ( wxCommandEvent &  anEvent  ) 

Reacts to the cntID_ENABLE_ACTUAL wxCommandEvent enables the actual to be between the the range. param & anEvent The wxCommandEvent actioned event

Reacts to the cntID_ENABLE_ACTUAL (false) wxCommandEvent enables the actual to be between the the range. param & anEvent The wxCommandEvent actioned event

Definition at line 1189 of file mBarRange.cxx.

References _in_rangeProperty, b_popmenu, cntID_ENABLE_ACTUAL, IsActualInRange(), and SetInRangeProperty().

01190         {
01191                 if (!_in_rangeProperty)
01192                 {
01193                         if(IsActualInRange())
01194                         {
01195                                 SetInRangeProperty (true);
01196                                 b_popmenu.SetLabel (cntID_ENABLE_ACTUAL, _T("Disable actual in range"));
01197                         }
01198                 }
01199                 else
01200                 {
01201                         SetInRangeProperty (false);
01202                         b_popmenu.SetLabel (cntID_ENABLE_ACTUAL, _T("Enable actual in range"));                 
01203                 }
01204         }

Here is the call graph for this function:

void mBarRange::onLeftClicDown ( wxMouseEvent &  event  ) 

Definition at line 1395 of file mBarRange.cxx.

References acceptedClick.

01396         {
01397                 acceptedClick = true;           
01398         }

void mBarRange::onLeftClickUp ( wxMouseEvent &  event  ) 

Definition at line 1400 of file mBarRange.cxx.

References acceptedClick.

01401         {       
01402                 acceptedClick = false;
01403         }

void mBarRange::OnMouseMove ( wxMouseEvent &  event  ) 

Definition at line 825 of file mBarRange.cxx.

References _h, _in_rangeProperty, _initialPoint, _max, _min, _moveActualWithBar, _orientation, _selectionMoveId, acceptedClick, activeState, clickedX, createAndSendEvent(), deviceStart_x, GetActual(), GetEnd(), getLogicValueofPixel(), GetPixelActual(), GetPixelEnd(), GetPixelStart(), GetStart(), logicInitial_actual, logicInitial_end, logicInitial_start, RefreshForce(), RefreshHorizontalView(), SetActual(), setClickedX(), SetEnd(), SetPixelActual(), SetPixelEnd(), SetPixelStart(), SetStart(), and withActualDrawed.

00826 {
00827 // EED Borrame
00828 //FILE *ff;
00829 //ff=fopen ("c:/temp/xxx.txt", "a+");
00830 //fprintf( ff , "mBarRange :: OnMouseMove 01\n" );
00831 //fclose(ff);
00832 
00833         //int px1=GetPixelStart(); // JPRx
00834         //int px2=GetPixelEnd(); // JPRx
00835         //int px3=GetPixelActual(); // JPRx
00836         if (activeState)
00837         {
00838                 wxPoint point = event.GetPosition();
00839                 int barHeight;
00840                 if (_orientation)
00841                 {
00842                         setClickedX(point.x);
00843                         barHeight = point.y;
00844                 }
00845                 else
00846                 {
00847                         setClickedX(point.y);
00848                         barHeight = point.x;
00849                 }
00850                 int logicClick = getLogicValueofPixel(clickedX);
00851                         
00852                 if( _selectionMoveId==-1 )
00853                 {
00854                         if (barHeight <=_h)
00855                         {
00856                                 bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
00857                                 bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
00858                                 bool in_actualT= withActualDrawed && (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
00859                                 bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
00860 
00861                                 if( in_actualT )
00862                                         _selectionMoveId = 3;
00863                                 else if(in_StartTri)
00864                                         _selectionMoveId = 1;  
00865                                 else if( in_EndTri )
00866                                         _selectionMoveId = 2;
00867                                 else if( in_movingBar )
00868                                         _selectionMoveId = 4;
00869                         }
00870                 }
00871                 else
00872                 {
00873                         if(acceptedClick)
00874                         {
00875                                 //is in start triagle
00876                                 if( _selectionMoveId ==1 && event.LeftIsDown())
00877                                 {
00878                                         bool validPos_StartTri = (logicClick<GetEnd() && logicClick >=_min);
00879                                         if( validPos_StartTri && !_in_rangeProperty)
00880                                         {       
00881                                                 SetPixelStart(clickedX);
00882                                                 RefreshForce();
00883                                                 RefreshHorizontalView();
00884                                                 //-------------------------------------------
00885                                                 // Sending the event of start triangle moved
00886                                                 //-------------------------------------------
00887                                                 createAndSendEvent( wxEVT_TSBAR_START );
00888                                         }
00889                                         //start has to be less than actual
00890                                         else if (validPos_StartTri && _in_rangeProperty)
00891                                         {
00892                                                 if(logicClick<=GetActual())
00893                                                 {
00894                                                         SetPixelStart(clickedX);
00895                                                         RefreshForce();
00896                                                 //      RefreshHorizontalView();
00897                                                         //-------------------------------------------
00898                                                         // Sending the event of start triangle moved
00899                                                         //-------------------------------------------
00900                                                 createAndSendEvent( wxEVT_TSBAR_START );
00901                                                 }
00902                                         }
00903                                 } // _selectionMoveId == 1
00904                                 //is in end triangle
00905                                 else if( _selectionMoveId == 2 && event.LeftIsDown() )
00906                                 {
00907                                         bool validPos_EndTri = logicClick>GetStart()&& logicClick<=_max;  
00908                                         if( validPos_EndTri && !_in_rangeProperty )
00909                                         {                                       
00910                                                 SetPixelEnd(clickedX);
00911                                                 RefreshForce();
00912         //                                      RefreshHorizontalView();        
00913                                                 //-------------------------------------------
00914                                                 //Sending the event of end triangle moved
00915                                                 //-------------------------------------------
00916                                                 createAndSendEvent( wxEVT_TSBAR_END );
00917                                         }
00918                                         //the end triangle cant be less than actual
00919                                         else if( validPos_EndTri && _in_rangeProperty )
00920                                         {
00921                                                 if(logicClick>=GetActual())
00922                                                 {
00923                                                         SetPixelEnd(clickedX);
00924                                                         RefreshForce();
00925                                                 //      RefreshHorizontalView();
00926                                                         //-------------------------------------------
00927                                                         //Sending the event of end triangle moved
00928                                                         //-------------------------------------------
00929                                                         createAndSendEvent( wxEVT_TSBAR_END );
00930                                                 }
00931                                         }
00932                                 } 
00933                                 //is the actual triangle
00934                                 else if( _selectionMoveId == 3 && event.LeftIsDown())
00935                                 {
00936                                         bool validPos_ActualTri=(logicClick<=_max) && (logicClick>=_min);
00937                                         //is in actual triangle but it could be anywhere
00938                                         if( validPos_ActualTri && !_in_rangeProperty )
00939                                         {
00940                                                 SetPixelActual(clickedX);
00941                                                 RefreshForce();
00942                                                 RefreshHorizontalView();
00943                                                 //-------------------------------------------
00944                                                 //Sending the event of actual triangle moved
00945                                                 //-------------------------------------------
00946                                                 createAndSendEvent( wxEVT_TSBAR_ACTUAL );       
00947 //                                              createAndSendEvent( 98765 );
00948 
00949 //printf("EED creaMaracasVisu mBarRange::OnMouseMove XXXXXXX \n");
00950 
00951                                         }
00952                                         else if( validPos_ActualTri && _in_rangeProperty )
00953                                         // the tringle in between start and end
00954                                         {
00955                                                 if( logicClick>=GetStart() && logicClick<=GetEnd())
00956                                                 {
00957                                                         SetPixelActual(clickedX);
00958                                                         RefreshForce();
00959                                                         RefreshHorizontalView();
00960                                                         //-------------------------------------------
00961                                                         //Sending the event of actual triangle moved
00962                                                         //-------------------------------------------
00963                                                         createAndSendEvent( wxEVT_TSBAR_ACTUAL );
00964                                                 }
00965                                         } 
00966                                 } 
00967                                 //is the bar
00968                                 else if ( _selectionMoveId == 4 &&  event.LeftIsDown() )
00969                                 {       
00970                                         //FILE * f=fopen("E:/borrar/file.txt","a+");
00971                                         if(_initialPoint == 0)
00972                                         {
00973                                                 _initialPoint = logicClick;
00974                                                 logicInitial_start = GetStart(); 
00975                                                 logicInitial_end = GetEnd();
00976                                                 logicInitial_actual = GetActual();
00977                                                 //SIL//fprintf(f,"\n\n---- Inicia draggin:\n  logicInitial_start:%d, logicInitial_end:%d,logicInitial_actual:%d \n", _initialPoint,logicInitial_start,logicInitial_end,logicInitial_actual);
00978                                         }
00979                                         int difference = logicClick -_initialPoint;
00980                                         int next_end = difference + logicInitial_end;
00981                                         int next_start = difference + logicInitial_start;
00982                                         int next_actual = difference + logicInitial_actual;
00983                                         
00984                                         /*SIL//fprintf(f,"diff:%d, next_end%d, next_start%d, next_actual%d \n", difference,next_end,next_start,next_actual);
00985                                         fclose(f);*/
00986                                         
00987                                         //if actual is not fixed to be in the middle
00988                                         if( ((logicClick>next_start) && (logicClick<next_end)&& (next_end<=_max)&& (next_start>=_min)) && !_in_rangeProperty)
00989                                         {
00990                                                 SetStart(next_start);
00991                                                 SetEnd(next_end);
00992                                                 if( _moveActualWithBar )
00993                                                 {
00994                                                         SetActual (next_actual);
00995                                                         //-------------------------------------------
00996                                                         //Sending the event of actual triangle moved
00997                                                         //-------------------------------------------
00998                                                         createAndSendEvent( wxEVT_TSBAR_ACTUAL );
00999                                                 }
01000                                                 RefreshForce();
01001                                                 RefreshHorizontalView();        
01002                                                                                         
01003                                                 //-------------------------------------------
01004                                                 // Sending the event that the bar ahs being moved
01005                                                 //-------------------------------------------
01006                                                 createAndSendEvent( wxEVT_TSBAR_MOVED );
01007                                         }
01008                                         //if actual has to be between start and end
01009                                         else if(_in_rangeProperty && ((next_start<=GetActual()) && (next_end>=GetActual()) && (next_end<=_max)&& (next_start>=_min)) )
01010                                         {
01011                                                 SetStart(next_start);
01012                                                 SetEnd(next_end);
01013                                                 if( _moveActualWithBar )
01014                                                 {
01015                                                         SetActual (next_actual);
01016                                                         //-------------------------------------------
01017                                                         //Sending the event of actual triangle moved
01018                                                         //-------------------------------------------
01019                                                         createAndSendEvent( wxEVT_TSBAR_ACTUAL );
01020                                                 }
01021                                                 RefreshForce();
01022                                                 RefreshHorizontalView();        
01023                                                 
01024                                                 //-------------------------------------------
01025                                                 // Sending the event that the bar ahs being moved
01026                                                 //-------------------------------------------
01027                                                 createAndSendEvent( wxEVT_TSBAR_MOVED );
01028                                         }
01029                                 }                       
01030                         }
01031                         if( !event.LeftIsDown())
01032                         {
01033                                 _initialPoint=0;
01034                                 _selectionMoveId = -1;
01035                                 RefreshForce();
01036                                 //-------------------------------------------
01037                                 //Sending a general event just because
01038                                 //-------------------------------------------
01039                                 //SIL//createAndSendEvent( wxEVT_TSBAR );
01040                                 createAndSendEvent(wxEVT_SELECTION_END);
01041                         }
01042                 }                               
01043         }       
01044 
01045 // EED Borrame
01046 //ff=fopen ("c:/temp/xxx.txt", "a+");
01047 //fprintf( ff , "  mBarRange :: OnMouseMove 02\n" );
01048 //fclose(ff);
01049 
01050 }

Here is the call graph for this function:

void mBarRange::onMovable_ActualWithBar ( wxCommandEvent &  anEvent  ) 

Reacts to the cntID_MOVABLE_ACTUAL_BAR wxCommandEvent by enabling or disabling the property of moving the actual triangle with the bar, just when it is inside of it. param & anEvent The wxCommandEvent actioned event

Definition at line 1210 of file mBarRange.cxx.

References _moveActualWithBar, b_popmenu, cntID_MOVABLE_ACTUAL_BAR, and IsActualInRange().

01211         {
01212                 if (_moveActualWithBar )
01213                 {
01214                         _moveActualWithBar = false;
01215                         b_popmenu.SetLabel (cntID_MOVABLE_ACTUAL_BAR, _T("Move actual+bar simultaneously"));
01216                 }
01217                 else
01218                 {
01219                         if(IsActualInRange())
01220                         {
01221                                 _moveActualWithBar = true;
01222                                 b_popmenu.SetLabel (cntID_MOVABLE_ACTUAL_BAR, _T("Move actual-bar independent"));
01223                         }
01224                 }
01225         }

Here is the call graph for this function:

void mBarRange::OnPaint ( wxPaintEvent &  WXUNUSEDevent  ) 

Definition at line 354 of file mBarRange.cxx.

References _bitmap_bar, _h, _orientation, _w, deviceEndMargin, deviceStart_x, deviceStart_y, RefreshHorizontalView(), RefreshVerticalView(), and trianglesHalfWidth.

00355 {
00356 
00357 // EED Borrame
00358 //FILE *ff;
00359 //ff=fopen ("c:/temp/xx.txt", "a+");
00360 //fprintf( ff , "pColorBar :: OnPaint 01\n" );
00361 //fclose(ff);
00362 
00363         if (_bitmap_bar!=NULL){
00364                 //repaint rectangle
00365                 if(_orientation)
00366                 {
00367                         RefreshHorizontalView();
00368                         wxMemoryDC temp_dc;
00369                         temp_dc.SelectObject( *_bitmap_bar );
00370                         wxPaintDC dc( this );
00371                         dc.Blit(deviceStart_x-(trianglesHalfWidth+2), deviceStart_y, _w-deviceEndMargin+2*(trianglesHalfWidth+2), _h, &temp_dc, 0, 0);
00372                         //repaint info
00373 //                      if (_visibleLables)
00374 //                      {
00375 //                              temp_dc.SelectObject( *_bitmap_info );                          
00376 //                              dc.Blit(deviceStart_x,deviceStart_y+_h, _w+deviceStart_x-deviceEndMargin, _h+deviceStart_y+200, &temp_dc, deviceStart_x, deviceStart_y);
00377 //                              //dc.Blit(deviceStart_x,deviceStart_y+_h, _w+deviceStart_x-deviceEndMargin, _h+deviceStart_y+60, &temp_dc, 0, 0);
00378 //                      }
00379         
00380                 } else {
00381                         RefreshVerticalView();
00382                         wxMemoryDC temp_dc;
00383                         temp_dc.SelectObject( *_bitmap_bar );
00384                         wxPaintDC dc( this );                   
00385 //                      dc.Blit(deviceStart_y,deviceStart_x, _h+deviceStart_y-deviceEndMargin,_w+deviceStart_x-deviceEndMargin, &temp_dc, 0, 0);        
00386                         dc.Blit(deviceStart_y,deviceStart_x-(trianglesHalfWidth+2), _h,_w-deviceEndMargin+2*(trianglesHalfWidth+2), &temp_dc, 0, 0);    
00387                         
00388                         //repaint info
00389 //                      if (_visibleLables)
00390 //                      {
00391 //                              temp_dc.SelectObject( *_bitmap_info );
00392 //                              dc.Blit(0,_w, _h+deviceStart_y+200, _w+deviceStart_x+200-deviceEndMargin, &temp_dc, deviceStart_y,_w+deviceStart_x);
00393 //                      }
00394 
00395 
00396                 } 
00397         } 
00398 
00399 // EED Borrame
00400 //ff=fopen ("c:/temp/xx.txt", "a+");
00401 //fprintf( ff , "pColorBar :: OnPaint 02\n" );
00402 //fclose(ff);
00403 
00404 
00405 }

Here is the call graph for this function:

void mBarRange::onShowPopupMenu ( wxMouseEvent &  event  ) 

Shows the popup menu

Definition at line 1112 of file mBarRange.cxx.

References _h, _orientation, _selectionMoveId, activeState, b_popmenu, clickedX, deviceStart_x, deviceStart_y, getClickedX(), GetPixelActual(), GetPixelEnd(), GetPixelStart(), and setClickedX().

01113         {
01114                 if (activeState)
01115                 {
01116                         bool validClic = false;
01117                         if (_orientation)
01118                         {
01119                                 validClic = event.GetX() >= deviceStart_x && event.GetY()<= (_h + deviceStart_y);
01120                         }
01121                         else
01122                         {
01123                                 validClic = event.GetX()>=deviceStart_y && event.GetX()<= (_h+deviceStart_y) && event.GetY()>deviceStart_x;
01124                         }
01125                         if (validClic)
01126                         {
01127                                 if(_orientation)
01128                                         setClickedX(event.GetX());
01129                                 else
01130                                         setClickedX(event.GetY());
01131 
01132                                 if (getClickedX()<=_h)
01133                                 {                                               
01134                                         bool in_StartTri = (clickedX>=GetPixelStart()-5+ deviceStart_x) && (clickedX<=GetPixelStart()+5+ deviceStart_x);
01135                                         bool in_EndTri = (clickedX>=GetPixelEnd()-5+ deviceStart_x) && (clickedX<=GetPixelEnd()+5+ deviceStart_x);
01136                                         bool in_actualT= (clickedX>=GetPixelActual()-5+ deviceStart_x) && (clickedX<=GetPixelActual()+5+ deviceStart_x);
01137                                         bool in_movingBar = (clickedX>GetPixelStart()+5+ deviceStart_x) && (clickedX<GetPixelEnd()-5+ deviceStart_x);
01138 
01139                                         if(in_StartTri)
01140                                                 _selectionMoveId = 1;
01141                                         else if( in_EndTri )
01142                                                 _selectionMoveId = 2;
01143                                         else if( in_actualT )
01144                                                 _selectionMoveId = 3;
01145                                         else if( in_movingBar )
01146                                                 _selectionMoveId = 4;
01147                                 }                               
01148                                 PopupMenu( &b_popmenu, event.GetX(), event.GetY());
01149                         }               
01150                 }
01151         }

Here is the call graph for this function:

void mBarRange::OnSize ( wxSizeEvent &  WXUNUSEDevent  ) 

Definition at line 316 of file mBarRange.cxx.

References _orientation, _selectionMoveId, deviceEndMargin, Refresh(), and SetWidth().

00317 {
00318         wxRect rectTotal = GetClientRect(); 
00319         if(_orientation)
00320         {               
00321                 SetWidth( rectTotal.GetWidth() - deviceEndMargin );                     
00322         } 
00323         else 
00324         {
00325                 SetWidth( rectTotal.GetHeight() - deviceEndMargin);                             
00326         }
00327         _selectionMoveId = -1;
00328         Refresh();              
00329 }

Here is the call graph for this function:

void mBarRange::Refresh ( bool  eraseBackground = true,
const wxRect *  rect = NULL 
)

Definition at line 333 of file mBarRange.cxx.

Referenced by OnSize(), RefreshForce(), and setIfWithActualDrawed().

00334 {
00335 // EED Borrame
00336 //FILE *ff;
00337 //ff=fopen ("c:/temp/xxx.txt", "a+");
00338 //fprintf( ff , "mBarRange :: Refresh 01\n" );
00339 //fclose(ff);
00340 
00341         wxScrolledWindow::Refresh(false);
00342 
00343 
00344 // EED Borrame
00345 //ff=fopen ("c:/temp/xx.txt", "a+");
00346 //fprintf( ff , "mBarRange :: Refresh 02\n" );
00347 //fclose(ff);
00348 }

Here is the caller graph for this function:

void mBarRange::RefreshForce (  ) 

Definition at line 819 of file mBarRange.cxx.

References Refresh().

Referenced by onChangePartColor(), OnMouseMove(), LoadRangeImage::RefreshSlice(), SetActual(), SetEnd(), LoadRangeImage::SetEndSlice(), SetStart(), and LoadRangeImage::SetStartSlice().

00820 {
00821         Refresh();
00822         Update();
00823 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::RefreshHorizontalView (  ) 

Definition at line 409 of file mBarRange.cxx.

References _bitmap_bar, _h, _max, _min, _selectionMoveId, _visibleLables, _w, actual_Colour, backgroundColor, bar_Colour, deviceEndMargin, end_Colour, GetActual(), GetEnd(), GetMax(), GetMin(), GetPixelActual(), GetPixelEnd(), GetPixelStart(), GetStart(), guideLineColor, realX_vertical_line, start_Colour, trianglesHalfWidth, and withActualDrawed.

Referenced by OnMouseMove(), and OnPaint().

00410 {
00411 
00412 // EED Borrame
00413 //FILE *ff;
00414 //ff=fopen ("c:/temp/xxx.txt", "a+");
00415 //fprintf( ff , "mBarRange :: RefreshHorizontalView 01\n" );
00416 //fclose(ff);
00417 
00418         wxPoint points[3];
00419 
00420         //int largestNumberWidthInPixels = 15; // JPRx
00421         int pxStart=GetPixelStart();
00422         int pxEnd=GetPixelEnd();
00423         int pxActual=GetPixelActual();
00424 
00425         
00426         int letterHeight = 9;
00427         int barHeight = 2*letterHeight;
00428         int tempHeight = _h-(6*letterHeight);
00429         
00430         
00431         if (_visibleLables)
00432         {
00433                 barHeight = (tempHeight>0)  ? tempHeight : (int) _h/2;
00434         }
00435         else
00436                 barHeight = _h; 
00437 
00438         wxMemoryDC temp_dc;
00439         temp_dc.SelectObject( *_bitmap_bar );
00440 
00441         
00442         // Background of this widget
00443         
00444         
00445         temp_dc.SetPen(wxPen( backgroundColor ));
00446         temp_dc.SetBrush(wxBrush( backgroundColor ,wxSOLID  ));
00447         
00448         temp_dc.DrawRectangle(0,0,_w+2*trianglesHalfWidth,_h);
00449         
00450 
00451         temp_dc.SetPen(wxPen( wxColour(167,165,191) ,1,wxSOLID  ));
00452         temp_dc.DrawLine(trianglesHalfWidth+2, 0, _w-deviceEndMargin, 0);
00453         temp_dc.DrawLine(trianglesHalfWidth+2, barHeight, (_w-deviceEndMargin-trianglesHalfWidth-2), barHeight);
00454         temp_dc.SetDeviceOrigin(trianglesHalfWidth+2,0);
00455 
00456 
00457         // Filling the bar
00458         temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00459         temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00460         temp_dc.DrawRectangle( pxStart , 0, pxEnd-pxStart, barHeight);
00461 
00462 
00463         //  The Bar
00464         if( _selectionMoveId==4 )
00465         {
00466                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00467                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00468         }
00469         else
00470         {
00471                 temp_dc.SetBrush(wxBrush( bar_Colour,wxSOLID  ));
00472                 temp_dc.SetPen(wxPen( wxColour(164,0,164),1,wxSOLID  ));
00473         }
00474         temp_dc.DrawRectangle( pxStart,1, pxEnd-pxStart, barHeight );
00475 
00476         // 2 Shadow Triangles: Start and End 
00477         temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00478         temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00479         points[0].x= 0;
00480         points[0].y= barHeight;
00481         points[1].x= -trianglesHalfWidth-1;
00482         points[1].y= 0;
00483         points[2].x= trianglesHalfWidth+2;
00484         points[2].y= 0;
00485         temp_dc.DrawPolygon(3,points,pxStart,0);
00486         temp_dc.DrawPolygon(3,points,pxEnd,0);
00487 
00488         // 2 Triangles: Start and End 
00489         points[1].x = -trianglesHalfWidth;      
00490         points[2].x = trianglesHalfWidth;
00491         
00492         //first triangle (start)
00493         if( _selectionMoveId == 1 )
00494         {
00495                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00496                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00497         }
00498         else
00499         {
00500                 temp_dc.SetBrush(wxBrush( start_Colour,wxSOLID  ));
00501                 temp_dc.SetPen(wxPen( wxColour(0,51,204),1,wxSOLID  ));
00502         }
00503         temp_dc.DrawPolygon(3,points,pxStart,0);
00504         //second triangle (end)
00505         if( _selectionMoveId == 2 )
00506         {
00507                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00508                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00509         }
00510         else
00511         {
00512                 temp_dc.SetBrush(wxBrush( end_Colour,wxSOLID  ));
00513                 temp_dc.SetPen(wxPen( wxColour(0,0,255),1,wxSOLID  ));
00514         }
00515         temp_dc.DrawPolygon(3,points,pxEnd,0);
00516 
00517         if( withActualDrawed )
00518         {
00519                 // 1 Shadow Triangle: Actual
00520                 temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00521                 temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00522                 points[1].x = -trianglesHalfWidth-1;
00523                 points[2].x = trianglesHalfWidth+2;
00524                 
00525                 temp_dc.DrawPolygon(3,points,pxActual,0);
00526 
00527                 // 1 Triangle: Actual (red)
00528                 if( _selectionMoveId==3 )
00529                 {
00530                         temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00531                         temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00532                 }
00533                 else
00534                 {
00535                         temp_dc.SetBrush(wxBrush( actual_Colour,wxSOLID  ));
00536                         temp_dc.SetPen(wxPen( wxColour(205,160,5),1,wxSOLID  ));
00537                 }
00538                 points[1].x = -trianglesHalfWidth;
00539                 points[2].x = trianglesHalfWidth;
00540                 temp_dc.DrawPolygon(3,points,pxActual,0);
00541         }
00542 
00543         if (realX_vertical_line!=-1)
00544         {
00545                 temp_dc.SetPen(wxPen(  guideLineColor,1,wxDOT ));
00546                 int pixelX_guide = ((realX_vertical_line - _min)*(_w-deviceEndMargin))/(_max - _min) ; 
00547                 temp_dc.DrawLine(pixelX_guide, 0, pixelX_guide, barHeight);
00548         }
00549 
00550         //Information Device drawing
00551 
00552         if (_visibleLables)
00553         {
00554                 //temp_dc.SelectObject( *_bitmap_info );
00555                 /*temp_dc.SetBrush(wxBrush( colourParent ,wxSOLID  ));
00556                 temp_dc.SetPen(wxPen( colourParent ,1,wxSOLID  ));*/
00557                 //temp_dc.DrawRectangle(deviceStart_x,_h+deviceStart_y,_w+deviceStart_x+40,_h+deviceStart_y+40);
00558                 //temp_dc.DrawRectangle(0,_h,_w+40-deviceEndMargin,_h+40);
00559 
00560                 wxFont font(letterHeight-1, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
00561                 temp_dc.SetFont(font);
00562                 temp_dc.SetTextForeground(*wxBLACK);
00563 
00564 
00565                 //the **MIN** value, always at the same y level that corresponds to barHeight+1
00566                 wxString text_min;
00567 //              text_min<< GetMin();
00568                 text_min.Printf(_T("%d"), (int)GetMin() );
00569                 
00570                 temp_dc.DrawText(text_min,0,barHeight+1);
00571 
00572                 //the **MAX** value always at the same place
00573                 wxString text_max;
00574 //              text_max << GetMax();
00575                 text_max.Printf(_T("%d"), (int)GetMax() );
00576 
00577                 //As there is a margin of 40 extra most numbers (max) should be visibles
00578 //              stringSize = temp_dc.GetTextExtent(text_max);
00579         wxCoord tmpX,tmpY;
00580                 temp_dc.GetTextExtent(text_max,&tmpX,&tmpY);
00581                 wxSize stringSize(tmpX,tmpY);
00582                 
00583                 temp_dc.DrawText(text_max,_w-deviceEndMargin -(stringSize.GetWidth())/*2*trianglesHalfWidth*/,barHeight+1);     
00584                 
00585                 //show logical values
00586                 //show the **START TRIANGLE** value 
00587                 wxString text_start;
00588 //              text_start << GetStart();               
00589                 text_start.Printf(_T("%d"), (int)GetStart() );
00590 
00591                 temp_dc.DrawText(text_start, pxStart,barHeight+2*letterHeight);
00592                 //show the **END TRIANGLE** value
00593                 wxString text_end;
00594 //              text_end << GetEnd();
00595                 text_end.Printf(_T("%d"), (int)GetEnd() );
00596 
00597 //              stringSize = temp_dc.GetTextExtent(text_end);
00598                 temp_dc.GetTextExtent(text_end,&tmpX,&tmpY);
00599                 stringSize.SetHeight(tmpY);
00600                 stringSize.SetWidth(tmpX);
00601                 temp_dc.DrawText(text_end, pxEnd-stringSize.GetWidth(),barHeight+3*letterHeight);
00602                 if( withActualDrawed )
00603                 {
00604                         //show the actual value of actual
00605                         wxString text_actual;
00606 //                      text_actual << GetActual();
00607                         text_actual.Printf(_T("%d"), (int)GetActual() );
00608 //                      stringSize = temp_dc.GetTextExtent(text_actual);
00609                         temp_dc.GetTextExtent(text_actual,&tmpX,&tmpY);
00610                     stringSize.SetHeight(tmpY);
00611                     stringSize.SetWidth(tmpX);
00612                         temp_dc.DrawText(text_actual, pxActual-(stringSize.GetWidth()/2),barHeight+letterHeight);                       
00613                 }                       
00614         }
00615 
00616 // EED Borrame
00617 //ff=fopen ("c:/temp/xxx.txt", "a+");
00618 //fprintf( ff , "mBarRange :: RefreshHorizontalView 02\n" );
00619 //fclose(ff);
00620 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::RefreshVerticalView (  ) 

Definition at line 626 of file mBarRange.cxx.

References _bitmap_bar, _h, _max, _min, _selectionMoveId, _visibleLables, _w, actual_Colour, backgroundColor, bar_Colour, deviceEndMargin, deviceStart_x, deviceStart_y, end_Colour, GetActual(), GetEnd(), GetMax(), GetMin(), GetPixelActual(), GetPixelEnd(), GetPixelStart(), GetStart(), guideLineColor, realX_vertical_line, start_Colour, trianglesHalfWidth, and withActualDrawed.

Referenced by OnPaint().

00627 {
00628 
00629 // EED Borrame
00630 //FILE *ff;
00631 //ff=fopen ("c:/temp/xxx.txt", "a+");
00632 //fprintf( ff , "mBarRange :: RefreshVerticalView 01\n" );
00633 //fclose(ff);
00634         wxPoint points[3];
00635 
00636         int px1=GetPixelStart();
00637         int px2=GetPixelEnd();
00638         int px3=GetPixelActual();
00639         int letterHeight = 9;
00640         int panelHeight = 9*3+_w;
00641 
00642         int barWidth;
00643         if (_visibleLables)
00644         {
00645                 barWidth = (_w-30)>0 ? _w-30 : (int) _w/2;
00646         }
00647         else
00648                 barWidth = _w;  
00649 
00650         wxMemoryDC temp_dc;
00651         temp_dc.SelectObject( *_bitmap_bar );
00652 
00653         // Background
00654         temp_dc.SetBrush(wxBrush( backgroundColor ,wxSOLID  ));
00655         temp_dc.SetPen(wxPen( backgroundColor ));
00656 
00657         temp_dc.DrawRectangle(0,0,_h,_w+2*trianglesHalfWidth);
00658         
00659 
00660         temp_dc.SetPen(wxPen( wxColour(167,165,191) ,1,wxSOLID  ));
00661         temp_dc.DrawLine(0,trianglesHalfWidth+2, 0, _w-deviceEndMargin);
00662         temp_dc.DrawLine(barWidth, trianglesHalfWidth+2, barWidth, (_w-deviceEndMargin-trianglesHalfWidth-2));
00663         temp_dc.SetDeviceOrigin(0,trianglesHalfWidth+2);
00664 
00665         // Filling the bar
00666         temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00667         temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00668         temp_dc.DrawRectangle( 0,px1 ,_h, px2-px1 );
00669 
00670 
00671         //  The Bar
00672                 if( _selectionMoveId==4 )
00673         {
00674                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00675                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00676         }
00677         else
00678         {
00679                 temp_dc.SetBrush(wxBrush( bar_Colour,wxSOLID  ));
00680                 temp_dc.SetPen(wxPen( wxColour(164,0,164),1,wxSOLID  ));
00681         }
00682         temp_dc.DrawRectangle( 1,px1,_h, px2-px1);
00683 
00684 
00685         // 2 Shadow Triangles: Start and End 
00686         points[0].x=_h;
00687         points[0].y=0;
00688         points[1].x=0;
00689         points[1].y=-trianglesHalfWidth-1;
00690         points[2].x=0;
00691         points[2].y=trianglesHalfWidth+2;
00692         temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00693         temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00694         temp_dc.DrawPolygon(3,points,0,px1);
00695         temp_dc.DrawPolygon(3,points,0,px2);
00696 
00697         // 2 Triangles: Start and End 
00698         points[0].x=_h;
00699         points[0].y=0;
00700         points[1].x=0;
00701         points[1].y=-trianglesHalfWidth;
00702         points[2].x=0;
00703         points[2].y=trianglesHalfWidth;
00704         //first triangle (start)
00705         if( _selectionMoveId==1 )
00706         {
00707                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00708                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00709         }
00710         else
00711         {
00712                 temp_dc.SetBrush(wxBrush( start_Colour,wxSOLID  ));
00713                 temp_dc.SetPen(wxPen( wxColour(0,51,204),1,wxSOLID  ));
00714         }
00715         temp_dc.DrawPolygon(3,points,0,px1);
00716         //second triangle (end)
00717         if( _selectionMoveId==2 )
00718         {
00719                 temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00720                 temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00721         }
00722         else
00723         {
00724                 temp_dc.SetBrush(wxBrush( end_Colour,wxSOLID  ));
00725                 temp_dc.SetPen(wxPen( wxColour(0,0,255),1,wxSOLID  ));
00726         }
00727         temp_dc.DrawPolygon(3,points,0,px2);
00728 
00729         if( withActualDrawed )
00730         {
00731                 // 1 Shadow Triangle: Actual
00732                 temp_dc.SetBrush(wxBrush( wxColour(104,104,104),wxSOLID  ));
00733                 temp_dc.SetPen(wxPen( wxColour(104,104,104),1,wxSOLID  ));
00734                 points[0].x=_h;
00735                 points[0].y=0;
00736                 points[1].x=0;
00737                 points[1].y=-trianglesHalfWidth-1;
00738                 points[2].x=0;
00739                 points[2].y=trianglesHalfWidth+2;
00740                 temp_dc.DrawPolygon(3,points,0,px3);
00741 
00742                 // 1 Triangle: Actual (red)
00743                 points[0].x = _h;
00744                 points[0].y = 0;
00745                 points[1].x = 0;
00746                 points[1].y = -trianglesHalfWidth;
00747                 points[2].x = 0;
00748                 points[2].y = trianglesHalfWidth;
00749                 if( _selectionMoveId==3 )
00750                 {
00751                         temp_dc.SetBrush(wxBrush( wxColour(128,255,0),wxSOLID  ));
00752                         temp_dc.SetPen(wxPen(  wxColour(0,128,0),1,wxSOLID  ));
00753                 }
00754                 else
00755                 {
00756                         temp_dc.SetBrush(wxBrush( actual_Colour,wxSOLID  ));
00757                         temp_dc.SetPen(wxPen( wxColour(205,160,5),1,wxSOLID  ));
00758                 }
00759                 temp_dc.DrawPolygon(3,points,0,px3);
00760         }
00761 
00762         if (realX_vertical_line!=-1)
00763         {
00764                 temp_dc.SetPen(wxPen(  guideLineColor,1,wxDOT  ));
00765                 int pixelX_guide = realX_vertical_line*_w/(_max-_min)+deviceStart_x; 
00766                 temp_dc.DrawLine(0,pixelX_guide, _h, pixelX_guide);
00767         }
00768 
00769         //Information Device drawing
00770         if (_visibleLables)
00771         {
00772                 /*temp_dc.SelectObject( *_bitmap_info );
00773 
00774                 temp_dc.SetBrush(wxBrush( backgroundColor ,wxSOLID  ));
00775                 temp_dc.SetPen(wxPen( backgroundColor ,1,wxSOLID  ));
00776                 temp_dc.DrawRectangle(deviceStart_y,_w+deviceStart_x,_h+deviceStart_y+200,_w+deviceStart_x+200);
00777 */
00778 
00779                 temp_dc.SetBackgroundMode(wxTRANSPARENT);
00780                 wxFont font(letterHeight-1, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL);
00781                 temp_dc.SetFont(font);
00782                 temp_dc.SetTextForeground(*wxBLACK);
00783 
00784                 //show logical values
00785                 //show the actual value of start
00786                 wxString text_start;
00787 //              text_start<<"Start:"<< GetStart();
00788                 text_start.Printf(_T("%s %d"),_T("Start: "), (int)GetStart() );
00789                 temp_dc.DrawText( text_start ,deviceStart_y, _w+deviceStart_x+letterHeight+1);
00790                 //show the actual value of end
00791                 wxString text_end;
00792 //              text_end <<"End: "<<GetEnd();
00793                 text_end.Printf(_T("%s %d"),_T("End: "), (int)GetEnd() );
00794                 temp_dc.DrawText( text_end ,deviceStart_y,_w+deviceStart_x+letterHeight*2 );
00795                 if( withActualDrawed )
00796                 {
00797                         //show the actual value of actual
00798                         wxString text_actual;
00799 //                      text_actual <<"Actual: " <<GetActual();
00800                         text_actual.Printf(_T("%s %d"),_T("Actual: "), (int)GetActual() );
00801                         temp_dc.DrawText( text_actual ,deviceStart_y,_w+deviceStart_x+letterHeight*3);
00802                 }
00803                 //the min value, always at the same place
00804                 wxString text_min;
00805 //              text_min<<"Min: " << GetMin();
00806                 text_min.Printf(_T("%s %d"),_T("Min: "), (int)GetMin() );
00807                 temp_dc.DrawText( text_min ,deviceStart_y,_w+deviceStart_x+3);
00808                 //the max value always at the samen place
00809                 wxString text_max;
00810 //              text_max <<"Max: "<< GetMax();
00811                 text_max.Printf(_T("%s %d"),_T("Max: "), (int)GetMax() );
00812                 //toca calcular cuantol lo corremos
00813                 temp_dc.DrawText(text_max,deviceStart_y,_w+deviceStart_x+43);           
00814         }
00815 
00816 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::setActiveStateTo ( bool  activeNow  ) 

Definition at line 1231 of file mBarRange.cxx.

References activeState.

01232         {
01233                 activeState = activeNow;
01234         }

void mBarRange::SetActual ( int  actual  ) 

Definition at line 293 of file mBarRange.cxx.

References _actual, _max, _min, and RefreshForce().

Referenced by OnMouseMove(), and LoadRangeImage::SetActualSlice().

00294 {
00295         if(actual<_min)
00296                 _actual = _min;
00297         else if (actual>_max)
00298                 _actual = _max;
00299         _actual=actual;
00300         RefreshForce();
00301 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::setBackgroundColor ( wxColour  theColor  ) 

Definition at line 1372 of file mBarRange.cxx.

References backgroundColor.

01373         {
01374                 backgroundColor = theColor;
01375         }

void mBarRange::setClickedX ( int  nwClickX  ) 

Definition at line 1294 of file mBarRange.cxx.

References clickedX.

Referenced by OnMouseMove(), and onShowPopupMenu().

01295         {
01296                 clickedX = nwClickX;
01297         }

Here is the caller graph for this function:

void mBarRange::setDeviceBlitStart ( wxCoord  devStart_x,
wxCoord  devStart_y 
)

Sets the device start drawing left-superior (pixel) start point param deviceStart_x Pixel start for x-coord param deviceStart_y Pixel start for y-coord

Definition at line 1086 of file mBarRange.cxx.

References _h, _orientation, _w, deviceStart_x, deviceStart_y, DrawBar(), GetPixelEnd(), SetPixelActual(), SetPixelEnd(), and SetPixelStart().

01087         {
01088                 deviceStart_x = devStart_x;
01089                 deviceStart_y = devStart_y;
01090                 // For the initialization case
01091                 if (GetPixelEnd()<0)
01092                 {
01093                         if (_orientation)
01094                         {
01095                                 SetPixelStart(deviceStart_x);
01096                                 SetPixelEnd(_w+deviceStart_x);
01097                                 SetPixelActual(deviceStart_x);
01098                         }
01099                         else
01100                         {
01101                                 SetPixelStart(deviceStart_x);
01102                                 SetPixelEnd(_h+deviceStart_x);
01103                                 SetPixelActual(deviceStart_x);
01104                         }
01105                 }
01106                 DrawBar();
01107         }

Here is the call graph for this function:

void mBarRange::setDeviceEndMargin ( int  newDeviceEnd_pixels  ) 

Definition at line 1276 of file mBarRange.cxx.

References deviceEndMargin.

01277         {
01278                 deviceEndMargin = newDeviceEnd_pixels;
01279         }

void mBarRange::SetEnd ( int  end  ) 

Definition at line 278 of file mBarRange.cxx.

References _end, _max, and RefreshForce().

Referenced by wxSTLWidget_03::ConfigureProcessing(), pPlotter::onChangeFunction(), OnMouseMove(), pPlotter::setAll(), and LoadRangeImage::SetEndSlice().

00279 {
00280         if(nwend>_max)
00281                 _end = _max;
00282         _end=nwend;
00283         RefreshForce(); 
00284 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::setGuideLineColour ( wxColour  theNwGuideLineColor  ) 

Definition at line 1381 of file mBarRange.cxx.

References guideLineColor.

01382         {
01383                 guideLineColor = theNwGuideLineColor;
01384         }

void mBarRange::SetHeight ( int  h  ) 

Definition at line 243 of file mBarRange.cxx.

References _h.

00244 {
00245         _h=h;   
00246 }

void mBarRange::setIfWithActualDrawed ( bool  drawActual  ) 

Definition at line 1336 of file mBarRange.cxx.

References b_popmenu, cntID_ENABLE_ACTUAL, cntID_MOVABLE_ACTUAL_BAR, Refresh(), and withActualDrawed.

01337         {
01338                 if(!withActualDrawed && drawActual)
01339                 {       
01340                         b_popmenu.Append (cntID_ENABLE_ACTUAL, _("Enable actual in range"), _("Enables/Disables the actual triangle to be or not in range"));
01341                         b_popmenu.Append (cntID_MOVABLE_ACTUAL_BAR, _("Move actual-bar simultaneously"), _("Disables the actual triangle to move with the bar"));               
01342                 }
01343                 else if (withActualDrawed && !drawActual)
01344                 {
01345                         b_popmenu.Remove(cntID_ENABLE_ACTUAL);
01346                         b_popmenu.Remove(cntID_MOVABLE_ACTUAL_BAR);
01347                 }
01348                 withActualDrawed = drawActual;
01349                 Refresh();      
01350         }

Here is the call graph for this function:

void mBarRange::SetInRangeProperty ( bool  in  ) 

Definition at line 121 of file mBarRange.cxx.

References _in_rangeProperty.

Referenced by onEnableRange_Actual().

00122 {
00123         _in_rangeProperty=in;
00124 }

Here is the caller graph for this function:

void mBarRange::SetMax ( double  i  ) 

Definition at line 204 of file mBarRange.cxx.

References _max.

Referenced by LoadRangeImage::SetStartSlice().

00205 {
00206         _max=i;
00207 }

Here is the caller graph for this function:

void mBarRange::SetMin ( double  i  ) 

Definition at line 218 of file mBarRange.cxx.

References _min.

Referenced by ThresholdImageViewPanel::ThresholdImageViewPanel().

00219 {
00220         _min=i;
00221 }

Here is the caller graph for this function:

void mBarRange::SetOrientation ( bool  orientation  ) 

Definition at line 141 of file mBarRange.cxx.

References _h, _orientation, and _w.

00142 {
00143         if(_orientation)
00144         {
00145                 SetSize(_h,_w);
00146         }
00147         _orientation=orientation;
00148 
00149 }

void mBarRange::SetPixelActual ( int  i  ) 

Definition at line 176 of file mBarRange.cxx.

References _actual, _max, _min, _w, deviceEndMargin, and deviceStart_x.

Referenced by OnMouseMove(), and setDeviceBlitStart().

00177 {
00178         _actual = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
00179 }

Here is the caller graph for this function:

void mBarRange::SetPixelEnd ( int  i  ) 

Definition at line 190 of file mBarRange.cxx.

References _end, _max, _min, _w, deviceEndMargin, and deviceStart_x.

Referenced by OnMouseMove(), and setDeviceBlitStart().

00191 {
00192         _end = _min + (i-deviceStart_x)*(_max-_min)/(_w-deviceEndMargin);
00193 }

Here is the caller graph for this function:

void mBarRange::SetPixelStart ( int  i  ) 

Definition at line 161 of file mBarRange.cxx.

References _max, _min, _start, _w, deviceEndMargin, and deviceStart_x.

Referenced by OnMouseMove(), and setDeviceBlitStart().

00162 {
00163         _start = _min+((i - deviceStart_x)*( _max - _min))/(_w-deviceEndMargin);
00164         
00165 }

Here is the caller graph for this function:

void mBarRange::setRealX_vertical_line ( int  newReal_x  ) 

Definition at line 1258 of file mBarRange.cxx.

References realX_vertical_line.

Referenced by pPlotter::onColorBar(), and pPlotter::onMoved_ColorPoint().

01259         {
01260                 realX_vertical_line = newReal_x;
01261         }

Here is the caller graph for this function:

void mBarRange::setRepresentedValues ( double  minRealValue,
double  maxRealValue 
)

Definition at line 1056 of file mBarRange.cxx.

References _end, _max, _min, and _start.

Referenced by wxSTLWidget_03::ConfigureProcessing(), and wxSTLWidget_03::OnRangeSpin().

01057 {
01058         _min = minRealValue;
01059         _max = maxRealValue;
01060         _start=_min;
01061         _end=_max;
01062 }

Here is the caller graph for this function:

void mBarRange::SetStart ( int  start  ) 

Definition at line 260 of file mBarRange.cxx.

References _min, _start, and RefreshForce().

Referenced by wxSTLWidget_03::ConfigureProcessing(), pPlotter::onChangeFunction(), OnMouseMove(), pPlotter::setAll(), LoadRangeImage::SetStartSlice(), and ThresholdImageViewPanel::ThresholdImageViewPanel().

00261 {
00262         if(newstart<_min)
00263                 newstart = _min;
00264         _start = newstart;
00265         RefreshForce(); 
00266 }

Here is the call graph for this function:

Here is the caller graph for this function:

void mBarRange::SetTrianglesHalfWidth ( int  nwTriHalfWidth  ) 

Definition at line 311 of file mBarRange.cxx.

References trianglesHalfWidth.

00312 {
00313         trianglesHalfWidth = nwTriHalfWidth;
00314 }

void mBarRange::setVisibleLabels ( bool  setVisible  ) 

Definition at line 1067 of file mBarRange.cxx.

References _visibleLables.

01068 {
01069         _visibleLables = setVisibleLB;
01070 }

void mBarRange::SetWidth ( int  w  ) 

Definition at line 232 of file mBarRange.cxx.

References _w.

Referenced by OnSize().

00233 {
00234         _w=w;
00235 }

Here is the caller graph for this function:


Member Data Documentation

int mBarRange::_actual [private]
wxBitmap* mBarRange::_bitmap_bar [private]

Definition at line 441 of file mBarRange.h.

Referenced by DrawBar(), OnPaint(), RefreshHorizontalView(), and RefreshVerticalView().

wxBitmap* mBarRange::_bitmap_info [private]

Definition at line 443 of file mBarRange.h.

Referenced by DrawBar().

int mBarRange::_end [private]
int mBarRange::_h [private]
int mBarRange::_initialPoint [private]

Definition at line 321 of file mBarRange.h.

Referenced by OnMouseMove().

double mBarRange::_max [private]
double mBarRange::_min [private]

Definition at line 339 of file mBarRange.h.

Referenced by OnMouseMove(), and onMovable_ActualWithBar().

bool mBarRange::_orientation [private]
int mBarRange::_start [private]
bool mBarRange::_visibleLables [private]
int mBarRange::_w [private]
bool mBarRange::acceptedClick [private]

Definition at line 433 of file mBarRange.h.

Referenced by onLeftClicDown(), onLeftClickUp(), and OnMouseMove().

bool mBarRange::activeState [private]

Definition at line 363 of file mBarRange.h.

Referenced by isActive(), OnMouseMove(), onShowPopupMenu(), and setActiveStateTo().

wxColour mBarRange::actual_Colour [private]

Definition at line 379 of file mBarRange.h.

Referenced by onChangePartColor(), RefreshHorizontalView(), and RefreshVerticalView().

wxMenu mBarRange::b_popmenu [private]
wxColour mBarRange::backgroundColor [private]

Definition at line 426 of file mBarRange.h.

Referenced by RefreshHorizontalView(), RefreshVerticalView(), and setBackgroundColor().

wxColour mBarRange::bar_Colour [private]

Definition at line 389 of file mBarRange.h.

Referenced by onChangePartColor(), RefreshHorizontalView(), and RefreshVerticalView().

int mBarRange::clickedX [private]

Definition at line 398 of file mBarRange.h.

Referenced by getClickedX(), OnMouseMove(), onShowPopupMenu(), and setClickedX().

wxCoord mBarRange::deviceEndMargin [private]
wxCoord mBarRange::deviceStart_x [private]
wxCoord mBarRange::deviceStart_y [private]
wxColour mBarRange::end_Colour [private]

Definition at line 384 of file mBarRange.h.

Referenced by onChangePartColor(), RefreshHorizontalView(), and RefreshVerticalView().

wxColour mBarRange::guideLineColor [private]

Definition at line 416 of file mBarRange.h.

Referenced by OnMouseMove().

Definition at line 412 of file mBarRange.h.

Referenced by OnMouseMove().

Definition at line 408 of file mBarRange.h.

Referenced by OnMouseMove().

Definition at line 404 of file mBarRange.h.

wxColour mBarRange::start_Colour [private]

Definition at line 374 of file mBarRange.h.

Referenced by onChangePartColor(), RefreshHorizontalView(), and RefreshVerticalView().


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

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1