<width>150</width>
<height>100</height>
<modal>false</modal>
+ <draggable>true</draggable>
<text>
<x>10</x>
modal - true if the dialog is modal (it blocks the rest of the
program), false otherwise. The default is false.
+ draggable - false if the dialog is not draggable. The default is true.
+
Example:
<PropertyList>
{
int result = puPopup::checkHit(button, updown, x, y);
+ if ( !_draggable)
+ return result;
+
// This is annoying. We would really want a true result from the
// superclass to indicate "handled by child object", but all it
// tells us is that the pointer is inside the dialog. So do the
if (type == "dialog") {
puPopup * dialog;
+ bool draggable = props->getBoolValue("draggable", true);
if (props->getBoolValue("modal", false))
dialog = new puDialogBox(x, y);
else
- dialog = new fgPopup(x, y);
+ dialog = new fgPopup(x, y, draggable);
setupGroup(dialog, props, width, height, color, true);
return dialog;
} else if (type == "group") {
//
class fgPopup : public puPopup {
public:
- fgPopup(int x, int y) : puPopup(x, y) { _dragging = false; }
+ fgPopup(int x, int y, bool d = true) : puPopup(x, y) { _dragging = false; _draggable = d;}
int checkHit(int b, int up, int x, int y);
int getHitObjects(puObject *, int x, int y);
private:
+ bool _draggable;
bool _dragging;
int _dX, _dY;
};