|  | @@ -930,7 +930,7 @@ int OPINV_UDFPropagate(laOperator *a, laEvent *e){
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  int OPINV_SendSignal(laOperator *a, laEvent *e){
 | 
	
		
			
				|  |  | -    const char* sig=strGetArgumentString(&a->ExtraInstructionsP,"signal"); if((!sig) || (!sig[0])) return LA_FINISHED;
 | 
	
		
			
				|  |  | +    const char* sig=strGetArgumentString(a->ExtraInstructionsP,"signal"); if((!sig) || (!sig[0])) return LA_FINISHED;
 | 
	
		
			
				|  |  |      laCustomSignal* cs=laFindSignal(sig);
 | 
	
		
			
				|  |  |      if(cs){ la_SendSignalEvent(e->window->win, cs->Signal); }
 | 
	
		
			
				|  |  |      return LA_FINISHED;
 | 
	
	
		
			
				|  | @@ -1595,6 +1595,19 @@ int OPINV_NewWindow(laOperator* a, laEvent* e){
 | 
	
		
			
				|  |  |      return LA_FINISHED;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +void *la_OnBlockFoldedHeader(laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  | +    int at;
 | 
	
		
			
				|  |  | +    laBlock *bb=0; int NoSubs = (b->B1==0);
 | 
	
		
			
				|  |  | +    if(NoSubs){
 | 
	
		
			
				|  |  | +        if (e->x>=b->X && e->x<=b->X+b->W && e->y>=b->Y-LA_SEAM_W && e->y<=b->Y+LA_SEAM_W){
 | 
	
		
			
				|  |  | +            return b;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return 0;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    bb=la_OnBlockFoldedHeader(b->B1,e); if(bb) return bb;
 | 
	
		
			
				|  |  | +    bb=la_OnBlockFoldedHeader(b->B2,e); if(bb) return bb;
 | 
	
		
			
				|  |  | +    return 0;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  |  void *la_OnBlockSeperator(laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  |      int at;
 | 
	
		
			
				|  |  |      laBlock *bb;
 | 
	
	
		
			
				|  | @@ -1611,8 +1624,7 @@ void *la_OnBlockSeperator(laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      if (bb = la_OnBlockSeperator(b->B1, e)) return bb;
 | 
	
		
			
				|  |  | -    else
 | 
	
		
			
				|  |  | -        return la_OnBlockSeperator(b->B2, e);
 | 
	
		
			
				|  |  | +    else return la_OnBlockSeperator(b->B2, e);
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  int la_DetectBlockDropLocation(laBlock *b, int X, int Y){
 | 
	
		
			
				|  |  |      laPanel *p = b->Panels.pFirst;
 | 
	
	
		
			
				|  | @@ -1702,6 +1714,48 @@ int la_ProcessBlockEvent(laOperator *a, laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        if (e->type == LA_MOUSEMOVE){
 | 
	
		
			
				|  |  | +            if (MAIN.CurrentWindow->CurrentLayout->ClickedPanel){
 | 
	
		
			
				|  |  | +                if (abs(e->x - uid->LastX) > LA_RH*3 || abs(e->y - uid->LastY) > LA_RH*3){
 | 
	
		
			
				|  |  | +                    l = MAIN.CurrentWindow->CurrentLayout;
 | 
	
		
			
				|  |  | +                    l->DropToBlock = b;
 | 
	
		
			
				|  |  | +                    l->DropLocation = la_DetectBlockDropLocation(b, e->x, e->y);
 | 
	
		
			
				|  |  | +                    laRefreshWindow();
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }elif (e->type == LA_L_MOUSE_UP){
 | 
	
		
			
				|  |  | +            l = MAIN.CurrentWindow->CurrentLayout;
 | 
	
		
			
				|  |  | +            if (l->DropToBlock){
 | 
	
		
			
				|  |  | +                l->DropToBlock = la_MakeDropBlock(l->DropToBlock,l->DropLocation);
 | 
	
		
			
				|  |  | +                p = l->ClickedPanel;
 | 
	
		
			
				|  |  | +                if(p->Block == l->DropToBlock){
 | 
	
		
			
				|  |  | +                    if(laTearOffPanel(p->Block, p)) Executed=1;
 | 
	
		
			
				|  |  | +                }else{
 | 
	
		
			
				|  |  | +                    p->Block->CurrentPanel = p->Item.pPrev ? p->Item.pPrev : (p->Item.pNext ? p->Item.pNext : 0);
 | 
	
		
			
				|  |  | +                    lstRemoveItem(&p->Block->Panels, p); laBlock* orig_block=p->Block->parent;
 | 
	
		
			
				|  |  | +                    int clear=0; if(!lstHaveItemInList(&p->Block->Panels)){clear=1;}
 | 
	
		
			
				|  |  | +                    lstPushItem(&l->DropToBlock->Panels, p);
 | 
	
		
			
				|  |  | +                    laUnfoldBlockTitle(l->DropToBlock);
 | 
	
		
			
				|  |  | +                    p->Block = l->DropToBlock;
 | 
	
		
			
				|  |  | +                    if(clear){
 | 
	
		
			
				|  |  | +                        laCombineChildBlocks(orig_block);
 | 
	
		
			
				|  |  | +                        if(!lstFindItem(orig_block->CurrentPanel,nutSameAddress,&orig_block->Panels)){
 | 
	
		
			
				|  |  | +                            orig_block->CurrentPanel = orig_block->Panels.pFirst;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    p->Block->CurrentPanel = p;
 | 
	
		
			
				|  |  | +                    Executed = 1;
 | 
	
		
			
				|  |  | +                    la_RecalcBlockRecursive(p->Block, p->Block->X, p->Block->Y, p->Block->W, p->Block->H);
 | 
	
		
			
				|  |  | +                    if(orig_block!=p->Block){
 | 
	
		
			
				|  |  | +                        la_RecalcBlockRecursive(orig_block, orig_block->X, orig_block->Y, orig_block->W, orig_block->H);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            MAIN.CurrentWindow->CurrentLayout->DropToBlock = 0;
 | 
	
		
			
				|  |  | +            MAIN.CurrentWindow->CurrentLayout->ClickedPanel = 0;
 | 
	
		
			
				|  |  | +            return 0;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          if(!b->Folded){
 | 
	
		
			
				|  |  |              for (p = b->Panels.pFirst; p; p = p->Item.pNext){ tw += (p->TitleWidth + LA_SEAM_W*2); }
 | 
	
		
			
				|  |  |              if (tw > b->W - LA_SEAM_W*2 - LA_RH) ratio = (real)(b->W - LA_SEAM_W*2 - LA_RH) / tw;
 | 
	
	
		
			
				|  | @@ -1717,70 +1771,26 @@ int la_ProcessBlockEvent(laOperator *a, laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                      LT = RT;
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -            }elif (e->type == LA_MOUSEMOVE){
 | 
	
		
			
				|  |  | -                if (abs(e->x - uid->LastX) > LA_RH*3 || abs(e->y - uid->LastY) > LA_RH*3){
 | 
	
		
			
				|  |  | -                    if (MAIN.CurrentWindow->CurrentLayout->ClickedPanel){
 | 
	
		
			
				|  |  | -                        l = MAIN.CurrentWindow->CurrentLayout;
 | 
	
		
			
				|  |  | -                        l->DropToBlock = b;
 | 
	
		
			
				|  |  | -                        l->DropLocation = la_DetectBlockDropLocation(b, e->x, e->y);
 | 
	
		
			
				|  |  | -                        laRefreshWindow();
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }elif (e->type == LA_L_MOUSE_UP){
 | 
	
		
			
				|  |  | -                l = MAIN.CurrentWindow->CurrentLayout;
 | 
	
		
			
				|  |  | -                if (l->DropToBlock){
 | 
	
		
			
				|  |  | -                    l->DropToBlock = la_MakeDropBlock(l->DropToBlock,l->DropLocation);
 | 
	
		
			
				|  |  | -                    p = l->ClickedPanel;
 | 
	
		
			
				|  |  | -                    if(p->Block == l->DropToBlock){
 | 
	
		
			
				|  |  | -                        if(laTearOffPanel(p->Block, p)) Executed=1;
 | 
	
		
			
				|  |  | -                    }else{
 | 
	
		
			
				|  |  | -                        p->Block->CurrentPanel = p->Item.pPrev ? p->Item.pPrev : (p->Item.pNext ? p->Item.pNext : 0);
 | 
	
		
			
				|  |  | -                        lstRemoveItem(&p->Block->Panels, p); laBlock* orig_block=p->Block->parent;
 | 
	
		
			
				|  |  | -                        int clear=0; if(!lstHaveItemInList(&p->Block->Panels)){clear=1;}
 | 
	
		
			
				|  |  | -                        lstPushItem(&l->DropToBlock->Panels, p);
 | 
	
		
			
				|  |  | -                        p->Block = l->DropToBlock;
 | 
	
		
			
				|  |  | -                        if(clear){
 | 
	
		
			
				|  |  | -                            laCombineChildBlocks(orig_block);
 | 
	
		
			
				|  |  | -                            if(!lstFindItem(orig_block->CurrentPanel,nutSameAddress,&orig_block->Panels)){
 | 
	
		
			
				|  |  | -                                orig_block->CurrentPanel = orig_block->Panels.pFirst;
 | 
	
		
			
				|  |  | -                            }
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        p->Block->CurrentPanel = p;
 | 
	
		
			
				|  |  | -                        Executed = 1;
 | 
	
		
			
				|  |  | -                        la_RecalcBlockRecursive(p->Block, p->Block->X, p->Block->Y, p->Block->W, p->Block->H);
 | 
	
		
			
				|  |  | -                        if(orig_block!=p->Block){
 | 
	
		
			
				|  |  | -                            la_RecalcBlockRecursive(orig_block, orig_block->X, orig_block->Y, orig_block->W, orig_block->H);
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                MAIN.CurrentWindow->CurrentLayout->DropToBlock = 0;
 | 
	
		
			
				|  |  | -                MAIN.CurrentWindow->CurrentLayout->ClickedPanel = 0;
 | 
	
		
			
				|  |  | -                return 0;
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -        }else{
 | 
	
		
			
				|  |  | -            if(!b->OnButton){ b->OnButton=1; laRefreshWindow(); } Ret=0;
 | 
	
		
			
				|  |  | -            if(laIsInBlockBotton1(b, e->x, e->y)){ if(b->OnButton!=2){b->OnButton=2;laRefreshWindow();} if(e->type==LA_L_MOUSE_DOWN){laUnfoldBlockTitle(b);Executed=1;Ret=1;} }
 | 
	
		
			
				|  |  | -            elif(laIsInBlockBotton2(b, e->x, e->y)){ if(b->OnButton!=2){b->OnButton=2;laRefreshWindow();}  if(e->type==LA_L_MOUSE_DOWN){laMaximizeBlock(b);Executed=1;Ret=1;} }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            if (!Executed && e->type == LA_L_MOUSE_DOWN && laIsInBlockBotton1(b, e->x, e->y)){
 | 
	
		
			
				|  |  | +                laui_BlockMenu(a, MAIN.CurrentWindow, MAIN.CurrentWindow->CurrentLayout, b, e);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (Executed){
 | 
	
		
			
				|  |  |              laRecalcPanel(b->CurrentPanel);
 | 
	
		
			
				|  |  |              la_RecalcBlockRecursive(b, b->X, b->Y, b->W, b->H);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -        if (!Executed && e->type == LA_L_MOUSE_DOWN && laIsInBlockBotton1(b, e->x, e->y)){
 | 
	
		
			
				|  |  | -            laui_BlockMenu(a, MAIN.CurrentWindow, MAIN.CurrentWindow->CurrentLayout, b, e);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  |          return Ret;
 | 
	
		
			
				|  |  | -    }else{
 | 
	
		
			
				|  |  | -        if(b->OnButton){b->OnButton=0;laRefreshWindow();} 
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      return 0;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  int la_ProcessBlockEdgeEvent(laOperator *WindowAct, laLayout *l, laBlock *b, laEvent *e){
 | 
	
		
			
				|  |  |      laBlock *ob = l->MovingBlock;
 | 
	
		
			
				|  |  |      laWindow *w = WindowAct->Instance;
 | 
	
		
			
				|  |  | -    if (e->type == LA_MOUSEMOVE && ob && l->MovingBlock && l->IsMoving){
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    if (e->type == LA_MOUSEMOVE && ob && l->MovingBlock && l->IsMoving==2){
 | 
	
		
			
				|  |  |          if (ob->Vertical) ob->SplitRatio = (real)(e->y - ob->Y) / (real)(ob->H);
 | 
	
		
			
				|  |  |          else ob->SplitRatio = (real)(e->x - ob->X) / (real)(ob->W);
 | 
	
		
			
				|  |  |          la_RecalcBlockRecursive(ob, ob->X, ob->Y, ob->W, ob->H);
 | 
	
	
		
			
				|  | @@ -1788,20 +1798,49 @@ int la_ProcessBlockEdgeEvent(laOperator *WindowAct, laLayout *l, laBlock *b, laE
 | 
	
		
			
				|  |  |          if (ob->B2->CurrentPanel) laRecalcPanel(ob->B2->CurrentPanel);
 | 
	
		
			
				|  |  |          return 1;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | -    if (ob = la_OnBlockSeperator(b, e)){
 | 
	
		
			
				|  |  | -        ob->B1->OnButton=ob->B2->OnButton=0;
 | 
	
		
			
				|  |  | +    laBlock* header_block=0;
 | 
	
		
			
				|  |  | +    if((header_block=la_OnBlockFoldedHeader(b,e)) && (header_block->Folded)){
 | 
	
		
			
				|  |  | +        if (header_block->CurrentPanel){
 | 
	
		
			
				|  |  | +            if (e->type == LA_MOUSE_WHEEL_DOWN && header_block->CurrentPanel->Item.pNext){
 | 
	
		
			
				|  |  | +                header_block->CurrentPanel = header_block->CurrentPanel->Item.pNext; laRedrawCurrentWindow(); return 1;
 | 
	
		
			
				|  |  | +            }elif (e->type == LA_MOUSE_WHEEL_UP && header_block->CurrentPanel->Item.pPrev){
 | 
	
		
			
				|  |  | +                header_block->CurrentPanel = header_block->CurrentPanel->Item.pPrev; laRedrawCurrentWindow(); return 1;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if(l->IsBlockHeaderClicked==1){ header_block=l->HeaderBlock; }
 | 
	
		
			
				|  |  | +        if(l->HeaderBlock!=header_block){ laRefreshWindow(); }
 | 
	
		
			
				|  |  | +        l->HeaderBlock=header_block;
 | 
	
		
			
				|  |  | +        if (e->type == LA_L_MOUSE_DOWN){
 | 
	
		
			
				|  |  | +            if((l->IsBlockHeaderClicked==1) && (tnsDistIdv2(l->LastX,l->LastY,e->x,e->y)<=LA_SEAM_W)){
 | 
	
		
			
				|  |  | +                l->IsBlockHeaderClicked=0; l->IsMoving=0; laUnfoldBlockTitle(header_block); return 1;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if(!l->IsBlockHeaderClicked){ l->IsBlockHeaderClicked = 1; l->LastX=e->x; l->LastY=e->y; laRefreshWindow(); }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }else{
 | 
	
		
			
				|  |  | +        l->IsBlockHeaderClicked = 0; l->HeaderBlock=0; laRefreshWindow();
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +    if ((l->IsMoving==1) || (ob = la_OnBlockSeperator(b, e))){
 | 
	
		
			
				|  |  | +        if(l->IsMoving==1){ ob=l->MovingBlock; }
 | 
	
		
			
				|  |  |          if(l->MovingBlock!=ob){ laRefreshWindow(); }
 | 
	
		
			
				|  |  |          l->MovingBlock = ob; laSetWindowCursor(ob->Vertical?LA_UP_AND_DOWN:LA_LEFT_AND_RIGHT);
 | 
	
		
			
				|  |  |          if (e->type == LA_L_MOUSE_DOWN){
 | 
	
		
			
				|  |  | -            l->IsMoving = 1;
 | 
	
		
			
				|  |  | +            if(!l->IsMoving){ l->IsMoving = 1; l->LastX=e->x; l->LastY=e->y; }
 | 
	
		
			
				|  |  | +        }elif (e->type == LA_MOUSEMOVE){
 | 
	
		
			
				|  |  | +            if(l->IsMoving==1){
 | 
	
		
			
				|  |  | +                if(ob->Vertical){ if(abs(e->y-l->LastY)>2*LA_SEAM_W){ l->IsMoving=2; } }
 | 
	
		
			
				|  |  | +                else{ if(abs(e->x-l->LastX)>2*LA_SEAM_W){ l->IsMoving=2; } }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |          }elif (e->type == LA_L_MOUSE_UP){
 | 
	
		
			
				|  |  | -            l->IsMoving = 0;
 | 
	
		
			
				|  |  | +            l->IsMoving = 0; laRefreshWindow();
 | 
	
		
			
				|  |  |          }elif (e->type == LA_R_MOUSE_DOWN){
 | 
	
		
			
				|  |  |              l->OnBlockSeperator = ob;
 | 
	
		
			
				|  |  |              laui_BlockEdgeMenu(WindowAct, l, ob, e);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          return 1;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    l->IsMoving = 0;
 | 
	
		
			
				|  |  |      if(l->MovingBlock){ l->MovingBlock = 0; laRefreshWindow(); laSetWindowCursor(LA_ARROW); }
 | 
	
		
			
				|  |  |      return 0;
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -1960,7 +1999,7 @@ int OPMOD_Window(laOperator *a, laEvent *e){
 | 
	
		
			
				|  |  |          if (la_ProcessBlockEdgeEvent(a, w->CurrentLayout, RootBlock, e)) return LA_RUNNING;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          b = w->MaximizedBlock?w->MaximizedBlock:laDetectBlockRecursive(w->CurrentLayout->FirstBlock, e->x, e->y);
 | 
	
		
			
				|  |  | -        laClearBlockButtonRecursive(RootBlock,b);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          if (b && la_ProcessBlockEvent(a, b, e)) return LA_RUNNING;
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          for (p = w->Panels.pFirst; p; p = p->Item.pNext){
 |