12 #ifndef AW_DEVICE_CLICK_HXX
13 #define AW_DEVICE_CLICK_HXX
29 client_data1 = click_cd->
get_cd1();
30 client_data2 = click_cd->
get_cd2();
37 void set_rel_pos(
double rel) {
aw_assert(rel >= 0.0 && rel <= 1.0); nearest_rel_pos = rel; }
51 set_rel_pos(nearest_rel_pos_);
70 inline bool is_box()
const;
113 textArea = textArea_;
118 return otherText ?
nearlyEqual(textArea, otherText->textArea) :
false;
138 return otherBox ?
nearlyEqual(box, otherBox->box) :
false;
162 for (
int i = 0; i<npos; ++i) pos[i] = other.pos[i];
174 if (pos)
delete [] pos;
180 for (
int i = 0; i<npos; ++i) pos[i] = pos_[i];
184 const AW_clicked_polygon *otherPoly =
dynamic_cast<const AW_clicked_polygon*
>(&other);
186 if (npos == otherPoly->npos) {
187 for (
int i = 0; i<npos; ++i) {
200 for (
int i = 1; i<npos; ++i) {
208 return new AW_clicked_polygon(*
this);
227 #define AWT_CATCH 30 // max-pixel distance to graphical element (to accept a click or command)
228 #define AWT_NO_CATCH -1
233 int max_distance_line;
234 int max_distance_text;
239 AW_clicked_polygon opt_polygon;
251 void specific_reset() OVERRIDE {}
265 #error aw_device_click.hxx included twice
266 #endif // AW_DEVICE_CLICK_HXX
void assign(int distance_, const AW_pos &nearest_rel_pos_, const AW_click_cd *click_cd_)
Position centroid() const
bool nearlyEqual(const double &val1, const double &val2)
AW::Rectangle get_bounding_box() const OVERRIDE
void assign(AW::Rectangle box_, int distance_, const AW_pos &nearest_rel_pos_, const AW_click_cd *click_cd_)
bool operator==(const AW_clicked_element &other) const OVERRIDE
virtual AW_clicked_element * clone() const =0
AW_clicked_polygon(const AW_clicked_polygon &other)
virtual AW::Rectangle get_bounding_box() const =0
AW_clicked_element * clone() const OVERRIDE
AW::Rectangle get_bounding_box() const OVERRIDE
const AW::Position * get_polygon(int &posCount) const
virtual ~AW_clicked_element()
bool operator==(const AW_clicked_element &other) const OVERRIDE
const Position & start() const
bool operator==(const AW_clicked_element &other) const OVERRIDE
const double & ypos() const
AW::Position get_attach_point() const OVERRIDE
int indicate_selected(AW_device *d, int gc) const OVERRIDE
AW::Position get_attach_point() const OVERRIDE
virtual AW_DEVICE_TYPE type()=0
virtual int indicate_selected(AW_device *d, int gc) const =0
bool generic_invisible(const AW::Position &pos, AW_bitset filteri)
const AW::LineVector & get_line() const
const Vector & line_vector() const
virtual bool operator==(const AW_clicked_element &other) const =0
AW::Rectangle get_bounding_box() const OVERRIDE
double get_rel_pos() const
AW::Position get_attach_point() const OVERRIDE
void assign(AW::Rectangle textArea_, int distance_, const AW_pos &nearest_rel_pos_, const AW_click_cd *click_cd_)
void assign(int npos_, const AW::Position *pos_, int distance_, const AW_pos &nearest_rel_pos_, const AW_click_cd *click_cd_)
AW::LineVector get_connecting_line(const AW_clicked_element &other) const
AW::Position get_attach_point() const OVERRIDE
AW_clicked_element * clone() const OVERRIDE
AW_clicked_element * clone() const OVERRIDE
virtual AW::Position get_attach_point() const =0
const double & xpos() const
void assign(const AW::LineVector &line_, int distance_, const AW_pos &nearest_rel_pos_, const AW_click_cd *click_cd_)
int indicate_selected(AW_device *d, int gc) const OVERRIDE
int indicate_selected(AW_device *d, int gc) const OVERRIDE