00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _SVT_SANEDLG_HXX
00036 #define _SVT_SANEDLG_HXX
00037
00038 #ifndef _SV_DIALOG_HXX
00039 #include <vcl/dialog.hxx>
00040 #endif
00041 #ifndef _CONFIG_HXX
00042 #include <tools/config.hxx>
00043 #endif
00044 #ifndef _SV_LSTBOX_HXX
00045 #include <vcl/lstbox.hxx>
00046 #endif
00047 #ifndef _SV_BUTTON_HXX
00048 #include <vcl/button.hxx>
00049 #endif
00050 #ifndef _SV_FIXED_HXX
00051 #include <vcl/fixed.hxx>
00052 #endif
00053 #ifndef _SV_GROUP_HXX
00054 #include <vcl/group.hxx>
00055 #endif
00056 #ifndef _SV_FIELD_HXX
00057 #include <vcl/field.hxx>
00058 #endif
00059 #ifndef _SV_EDIT_HXX
00060 #include <vcl/edit.hxx>
00061 #endif
00062 #include <svtools/svtreebx.hxx>
00063
00064 #include <sane.hxx>
00065
00066 class SaneDlg : public ModalDialog
00067 {
00068 private:
00069 enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
00070 BottomLeft, Left };
00071
00072 Sane& mrSane;
00073 Bitmap maPreviewBitmap;
00074 Rectangle maPreviewRect;
00075 Point maTopLeft, maBottomRight;
00076 Point maMinTopLeft, maMaxBottomRight;
00077 BOOL mbDragEnable;
00078 BOOL mbIsDragging;
00079 int mnDragMode;
00080 BOOL mbDragDrawn;
00081 DragDirection meDragDirection;
00082
00083 MapMode maMapMode;
00084
00085 Link maOldLink;
00086
00087 OKButton maOKButton;
00088 CancelButton maCancelButton;
00089 PushButton maDeviceInfoButton;
00090 PushButton maPreviewButton;
00091 PushButton maButtonOption;
00092
00093 FixedText maOptionsTxt;
00094 FixedText maOptionTitle;
00095 FixedText maOptionDescTxt;
00096 FixedText maVectorTxt;
00097
00098 FixedText maScanLeftTxt;
00099 MetricField maLeftField;
00100 FixedText maScanTopTxt;
00101 MetricField maTopField;
00102 FixedText maRightTxt;
00103 MetricField maRightField;
00104 FixedText maBottomTxt;
00105 MetricField maBottomField;
00106
00107 FixedText maDeviceBoxTxt;
00108 ListBox maDeviceBox;
00109 FixedText maReslTxt;
00110 NumericBox maReslBox;
00111 FixedText maAdvancedTxt;
00112 CheckBox maAdvancedBox;
00113
00114 NumericField maVectorBox;
00115 ListBox maQuantumRangeBox;
00116 ListBox maStringRangeBox;
00117
00118 FixedLine maPreviewBox;
00119 FixedLine maAreaBox;
00120
00121 CheckBox maBoolCheckBox;
00122
00123 Edit maStringEdit;
00124 Edit maNumericEdit;
00125
00126 SvTreeListBox maOptionBox;
00127
00128 int mnCurrentOption;
00129 int mnCurrentElement;
00130 double* mpRange;
00131 double mfMin, mfMax;
00132
00133 DECL_LINK( ClickBtnHdl, Button* );
00134 DECL_LINK( SelectHdl, ListBox* );
00135 DECL_LINK( ModifyHdl, Edit* );
00136 DECL_LINK( ReloadSaneOptionsHdl, Sane* );
00137 DECL_LINK( OptionsBoxSelectHdl, SvTreeListBox* );
00138
00139 void SaveState();
00140 BOOL LoadState();
00141
00142 void InitDevices();
00143 void InitFields();
00144 void AcquirePreview();
00145 void DisableOption();
00146 void EstablishBoolOption();
00147 void EstablishStringOption();
00148 void EstablishStringRange();
00149 void EstablishQuantumRange();
00150 void EstablishNumericOption();
00151 void EstablishButtonOption();
00152
00153 void DrawRectangles( Point&, Point& );
00154 void DrawDrag();
00155 Point GetPixelPos( const Point& );
00156 Point GetLogicPos( const Point& );
00157 void UpdateScanArea( BOOL );
00158
00159
00160 BOOL SetAdjustedNumericalValue( const char* pOption, double fValue, int nElement = 0 );
00161
00162 virtual void Paint( const Rectangle& );
00163 virtual void MouseMove( const MouseEvent& rMEvt );
00164 virtual void MouseButtonDown( const MouseEvent& rMEvt );
00165 virtual void MouseButtonUp( const MouseEvent& rMEvt );
00166 public:
00167 SaneDlg( Window*, Sane& );
00168 ~SaneDlg();
00169
00170 virtual short Execute();
00171 };
00172
00173
00174 #endif