bright-gpu-74537
02/01/2023, 8:05 AMbright-gpu-74537
02/01/2023, 8:08 AMbright-gpu-74537
02/01/2023, 8:09 AMbright-gpu-74537
02/01/2023, 8:45 AMvalidator(s)
attributes in interactive components validator="email"
for shorthand or use <validator>
under the component for long form (which will be useful for custom configurations - which isnt implemented yet)bright-gpu-74537
02/01/2023, 8:57 AMbright-gpu-74537
02/01/2023, 8:57 AMxml
<validators>
<validator id="required" class="haxe.ui.validators.RequiredValidator" />
<validator id="pattern" class="haxe.ui.validators.PatternValidator" />
<validator id="email" class="haxe.ui.validators.EmailValidator" />
</validators>
refined-greece-48002
02/01/2023, 10:10 AMbright-gpu-74537
02/01/2023, 10:13 AMrefined-greece-48002
02/01/2023, 10:14 AMbright-gpu-74537
02/01/2023, 10:14 AMbright-gpu-74537
02/01/2023, 12:27 PMxml
<dropdown id="dd" text="" width="200" validators="required">
<validator type="pattern" pattern="(?!Item 4)Item.*" />
<data>
<item text="Item 1" />
<item text="Item 2" />
<item text="ianharrigan@hotmail.com" />
<item text="Item 4" />
<item text="Item 5" />
</data>
</dropdown>
ambitious-knife-25690
02/01/2023, 12:55 PMambitious-knife-25690
02/01/2023, 12:55 PMbright-gpu-74537
02/01/2023, 1:00 PMbright-gpu-74537
02/01/2023, 1:02 PMhaxe
if (!cast(this, Component).hitTest(currentMouseX, currentMouseY)) {
return;
}
// dispatch event
bright-gpu-74537
02/01/2023, 1:04 PMxml
<validators>
<validator id="myEmail" class="haxe.ui.validators.PatternValidator" pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$" applyValid="false" />
</validators>
ambitious-knife-25690
02/01/2023, 1:06 PMambitious-knife-25690
02/01/2023, 1:07 PMbright-gpu-74537
02/01/2023, 1:07 PMbright-gpu-74537
02/01/2023, 1:08 PMbright-gpu-74537
02/01/2023, 1:08 PMambitious-knife-25690
02/01/2023, 1:09 PMambitious-knife-25690
02/01/2023, 1:09 PMbright-gpu-74537
02/01/2023, 1:10 PMvalidator="email"
), but then, for me, i dont want the box to go "green" when its right, i just want the red... so can just override the "email" validator in my module.xml and viola, all sortedbright-gpu-74537
02/01/2023, 1:11 PMxml
<validators>
<validator id="email" class="haxe.ui.validators.EmailValidator" applyValid="false" />
</validators>
ambitious-knife-25690
02/01/2023, 1:44 PMambitious-knife-25690
02/01/2023, 1:44 PMambitious-knife-25690
02/01/2023, 1:45 PMambitious-knife-25690
02/01/2023, 1:46 PMhx
override function handleClipRect(value:Rectangle):Void {
if (value == null) {
this.clipQuad = null;
} else {
if (this.clipQuad == null) {
this.clipQuad = new Quad();
this.clipQuad.visible = true;
if (this.parentComponent != null) {
this.parentComponent.visual.add(clipQuad);
} else {
this.visual.add(clipQuad);
}
}
// this.clipQuad.x = value.left + visual.x - parentComponent.visual.x;
// this.clipQuad.y = value.top;
this.x = -value.left;
this.y = -value.top;
this.clipQuad.x = left;
this.clipQuad.y = top;
this.clipQuad.width = value.width;
this.clipQuad.height = value.height;
// trace('x: $x | y: $y | cx: $clipX | cy: $clipY |w: ${value.width} |h:${value.height}');
}
}
ambitious-knife-25690
02/01/2023, 1:46 PM