|
@@ -2727,79 +2727,97 @@ int OPMOD_TabSelector(laOperator *a, laEvent *e){
|
|
|
|
|
|
return LA_RUNNING_PASS;
|
|
|
}
|
|
|
-int OPMOD_Collection(laOperator *a, laEvent *e){
|
|
|
- laUiItem *ui = a->Instance;
|
|
|
- laGeneralUiExtraData *uit = a->CustomData;
|
|
|
- laListHandle Locals = {0};
|
|
|
- laUiList *uil;
|
|
|
- int lx = e->x, ly = e->y;
|
|
|
- int at = 0;
|
|
|
- laUiList* ToUil = a->ToPanel->MenuRefer?a->ToPanel->MenuRefer:&a->ToPanel->UI;
|
|
|
-
|
|
|
- if (!laIsInUiItem(ui, e->x, e->y) /* || e->y>(ui->Subs.pFirst?((laUiList*)ui->Subs.pFirst)->HeightCoeff:10000)*/){
|
|
|
- return LA_FINISHED_PASS;
|
|
|
- }
|
|
|
-
|
|
|
- laLocalToPanel(a, &lx, &ly); if(a->ToPanel && ly<a->ToPanel->TitleBar.B){ return LA_FINISHED_PASS; }
|
|
|
- uil = la_DetectUiListRecursive(ToUil, lx, ly, 10000, 0, 0, 0, 0, 0);
|
|
|
- if (uil != ((laUiListDrawItem *)a->LocalUiLists.pFirst)->Target){
|
|
|
- //printf("EXIT\n");
|
|
|
- return LA_FINISHED;
|
|
|
- }
|
|
|
-
|
|
|
- if (e->Type & LA_MOUSE_EVENT){
|
|
|
- laUiList *sub;
|
|
|
- laUiItem *tui;
|
|
|
- int LimHeight = 10000;
|
|
|
- int UIB = ui->B, UIU = ui->U;
|
|
|
- int t = 0;
|
|
|
- void *Active = ui->PP.EndInstance;
|
|
|
- if (ui->Subs.pFirst) LimHeight = (int)((laUiList *)ui->Subs.pFirst)->HeightCoeff;
|
|
|
- if (LimHeight > 0) UIB = LimHeight;
|
|
|
- laPanelToLocal(a, &t, &UIB);
|
|
|
- for (sub = ui->Subs.pFirst; sub; sub = sub->Item.pNext){
|
|
|
- ui->PP.EndInstance = sub->Instance;
|
|
|
- if ((tui = la_DetectUiItemRecursive(sub, e->x, e->y, UIB, &Locals, 0))){
|
|
|
- if (tui && !a->Child && tui->Type->OperatorType){
|
|
|
- //printf("invui %d\n", tui);
|
|
|
- laSetOperatorLocalizer(a->ToPanel);
|
|
|
- laInvokeUiP(a, tui->Type->OperatorType, e, tui, &Locals, 0);
|
|
|
- }
|
|
|
- }
|
|
|
- lstClearPointer(&Locals);
|
|
|
+int OPMOD_Collection(laOperator *a, laEvent *e) {
|
|
|
+ laUiItem *ui = a->Instance;
|
|
|
+ laGeneralUiExtraData *uit = a->CustomData;
|
|
|
+ laListHandle Locals = {0};
|
|
|
+ laUiList *uil;
|
|
|
+ int lx = e->x, ly = e->y;
|
|
|
+ int at = 0;
|
|
|
+ laUiList *ToUil =
|
|
|
+ a->ToPanel->MenuRefer ? a->ToPanel->MenuRefer : &a->ToPanel->UI;
|
|
|
+
|
|
|
+ if (!laIsInUiItem(ui, e->x, e->y) /* || e->y>(ui->Subs.pFirst?((laUiList*)ui->Subs.pFirst)->HeightCoeff:10000)*/){
|
|
|
+ return LA_FINISHED_PASS;
|
|
|
+ }
|
|
|
+
|
|
|
+ laLocalToPanel(a, &lx, &ly);
|
|
|
+ if (a->ToPanel && ly < a->ToPanel->TitleBar.B) {
|
|
|
+ return LA_FINISHED_PASS;
|
|
|
+ }
|
|
|
+ uil = la_DetectUiListRecursive(ToUil, lx, ly, 10000, 0, 0, 0, 0, 0);
|
|
|
+ if (uil != ((laUiListDrawItem *)a->LocalUiLists.pFirst)->Target) {
|
|
|
+ // printf("EXIT\n");
|
|
|
+ return LA_FINISHED;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (e->Type & LA_MOUSE_EVENT) {
|
|
|
+ laUiList *sub;
|
|
|
+ laUiItem *tui;
|
|
|
+ int LimHeight = 10000;
|
|
|
+ int UIB = ui->B, UIU = ui->U;
|
|
|
+ int t = 0;
|
|
|
+ void *Active = ui->PP.EndInstance;
|
|
|
+ if (ui->Subs.pFirst)
|
|
|
+ LimHeight = (int)((laUiList *)ui->Subs.pFirst)->HeightCoeff;
|
|
|
+ if (LimHeight > 0)
|
|
|
+ UIB = LimHeight;
|
|
|
+ laPanelToLocal(a, &t, &UIB);
|
|
|
+ for (sub = ui->Subs.pFirst; sub; sub = sub->Item.pNext) {
|
|
|
+ ui->PP.EndInstance = sub->Instance;
|
|
|
+ if ((tui = la_DetectUiItemRecursive(sub, e->x, e->y, UIB, &Locals, 0))) {
|
|
|
+ if (tui && !a->Child && tui->Type->OperatorType) {
|
|
|
+ // printf("invui %d\n", tui);
|
|
|
+ laSetOperatorLocalizer(a->ToPanel);
|
|
|
+ laInvokeUiP(a, tui->Type->OperatorType, e, tui, &Locals, 0);
|
|
|
}
|
|
|
- ui->PP.EndInstance = Active;
|
|
|
+ }
|
|
|
+ lstClearPointer(&Locals);
|
|
|
}
|
|
|
+ ui->PP.EndInstance = Active;
|
|
|
+ }
|
|
|
|
|
|
- if (e->Type == LA_L_MOUSE_DOWN && (!laIsPropertyReadOnly(&ui->PP)) && ui->Type!=_LA_UI_COLLECTION_SINGLE){
|
|
|
- laUiList *uil;
|
|
|
- for (uil = ui->Subs.pFirst; uil; uil = uil->Item.pNext){
|
|
|
- if (a->ConfirmData) return LA_RUNNING_PASS;
|
|
|
- if (laIsInBound(e->x, e->y, uil->L, uil->R, uil->U, uil->B)){
|
|
|
- laRecalcCurrentPanel();
|
|
|
- laPropPack PP={0}; la_CopyPropPack(&ui->PP, &PP); //needed because layout can be switched after set active.
|
|
|
- char* cmd; if ((!(cmd = strGetArgumentString(ui->Instructions, "feedback"))) || (!strSame(cmd, "NONE"))) {
|
|
|
- laConfirmInt(a, 0, LA_CONFIRM_DATA);
|
|
|
- }
|
|
|
- laSetActiveInstance(ui->PP.LastPs->p, ui->PP.LastPs->UseInstance, uil->Instance);
|
|
|
- laRecordAndPushProp(&PP,0); laMarkPropChanged(&PP);
|
|
|
- return LA_RUNNING_PASS;
|
|
|
- }
|
|
|
+ if (e->Type == LA_L_MOUSE_DOWN && (!laIsPropertyReadOnly(&ui->PP)) &&
|
|
|
+ ui->Type != _LA_UI_COLLECTION_SINGLE) {
|
|
|
+ laUiList *uil;
|
|
|
+ for (uil = ui->Subs.pFirst; uil; uil = uil->Item.pNext) {
|
|
|
+ if (a->ConfirmData)
|
|
|
+ return LA_RUNNING_PASS;
|
|
|
+ if (laIsInBound(e->x, e->y, uil->L, uil->R, uil->U, uil->B)) {
|
|
|
+ laRecalcCurrentPanel();
|
|
|
+ laPropPack PP = {0};
|
|
|
+ la_CopyPropPack(
|
|
|
+ &ui->PP,
|
|
|
+ &PP); // needed because layout can be switched after set active.
|
|
|
+ char *cmd;
|
|
|
+ if ((!(cmd = strGetArgumentString(ui->Instructions, "feedback"))) ||
|
|
|
+ (!strSame(cmd, "NONE"))) {
|
|
|
+ laConfirmInt(a, 0, LA_CONFIRM_DATA);
|
|
|
}
|
|
|
- return LA_RUNNING;
|
|
|
+ laSetActiveInstance(ui->PP.LastPs->p, ui->PP.LastPs->UseInstance,
|
|
|
+ uil->Instance);
|
|
|
+ laRecordAndPushProp(&PP, 0);
|
|
|
+ laMarkPropChanged(&PP);
|
|
|
+ return LA_RUNNING_PASS;
|
|
|
+ }
|
|
|
}
|
|
|
- elif (e->Type == LA_R_MOUSE_DOWN) {
|
|
|
- laUiList* uil;
|
|
|
- for (uil = ui->Subs.pFirst; uil; uil = uil->Item.pNext) {
|
|
|
- if (laIsInBound(e->x, e->y, uil->L, uil->R, uil->U, uil->B)) {
|
|
|
- ui->PP.EndInstance=uil->Instance; lx=e->x, ly=e->y; laLocalToWindow(a,a->ToPanel,&lx,&ly);
|
|
|
- laEnablePropertyPanel(a->ToPanel,a,0,0,laui_IdentifierOnly,&ui->PP,lx,lx,ly,0,0,e);
|
|
|
- }
|
|
|
- }
|
|
|
- return LA_RUNNING;
|
|
|
+ return LA_RUNNING;
|
|
|
+ }
|
|
|
+ elif (e->Type == LA_R_MOUSE_DOWN) {
|
|
|
+ laUiList *uil;
|
|
|
+ for (uil = ui->Subs.pFirst; uil; uil = uil->Item.pNext) {
|
|
|
+ if (laIsInBound(e->x, e->y, uil->L, uil->R, uil->U, uil->B)) {
|
|
|
+ ui->PP.EndInstance = uil->Instance;
|
|
|
+ lx = e->x, ly = e->y;
|
|
|
+ laLocalToWindow(a, a->ToPanel, &lx, &ly);
|
|
|
+ laEnablePropertyPanel(a->ToPanel, a, 0, 0, laui_IdentifierOnly, &ui->PP,
|
|
|
+ lx, lx, ly, 0, 0, e);
|
|
|
+ }
|
|
|
}
|
|
|
+ return LA_RUNNING;
|
|
|
+ }
|
|
|
|
|
|
- return LA_RUNNING_PASS;
|
|
|
+ return LA_RUNNING_PASS;
|
|
|
}
|
|
|
int OPMOD_CollectionSelector(laOperator *a, laEvent *e){
|
|
|
laUiItem *ui = a->Instance;
|