CalWin
  • Introduction
  • Code Snippets
  • Useful SQL statements
  • CalWin Script
    • Hardware Script
      • GetQty
      • DefineParts
      • WorkXXX
      • Script classes
        • TWorkWrapper
        • TFrameWrapper
        • TDividerWrapper
    • System script Events
      • OnAdjustStainLoad
      • OnAfterCalcItemRequirement
      • OnCalcPriceListAddition
      • OnCalcProductPurchaseDeliveryTime
      • OnCalcSalesHeaderAutoLineData
      • OnCalcSashLeadWeight
      • OnCheckFromSemiStock
      • OnCheckFromStock
      • OnCheckGlassFromStock
      • OnCheckProduct
      • OnCheckSalesheaderRules
      • OnCheckSaleslineDates
      • OnGetBatchGroup
      • OnGetClassification
      • OnGetDiscountGroup
      • OnGetElementProfile
      • OnGetLoadPoints
      • OnGetProductSourceAltParams
      • OnGetProductSourceParams
      • OnGetprofile (deprecated)
      • OnGetSaleslinesSourceParams
      • OnGetStockItemGroup
      • OnIncludeBottleneckLoad
      • OnIncludeCheckpoint
      • OnIsSpecialProduct
      • OnModifyEdgeList
      • OnModifyKickPlate
      • OnModifyVariants_Final
      • OnModifyVariants_Initial
      • OnSalesheaderPriceFinalization
      • OnSetElementJointType
      • OnSetSileDividersPos
      • OnSetTranMullDesignCode
      • OnSetTranMullDividersPos
      • Helper Procedure Repository
        • Loop ElementList
    • Machine Link
      • Machine Link Events
        • Initialize and Finalize
        • BeforeOptimization
        • PreParseMain_xxx
        • PostParseMain_xxx
        • ParseChild_xxx
        • BeforeOutput_xxx
      • How to use a search table in Machine Link
  • Brukerdokumentasjon (NOR)
    • Fullkostkalkyle
    • Bonus og markedsstøtte
    • CalWin enhet og faktor
    • Kalenderen
    • Budsjett
    • Eksport til Excel
    • Dokument-hÃ¥ndtering
  • Misc documentation
    • CalWin 64-bit Beta
    • CalWin E-Quote
    • CalWin WEB Dashboard
    • Oracle related
      • Oracle Database Server Requirements
      • Oracle DBA
        • Resize and rename data files
        • Arhivelog mode
        • LISTENER.ORA
        • Connection strings
        • Create Oracle user (schema) for CalWin
        • Create a database link
        • Password expiration
        • Add a Directory object
        • Show table space size
        • Recovery Area Space
        • ORA-00257 - not enough space in recovery file
    • CalWin Server
      • Legg til web certificate
Powered by GitBook
On this page

Was this helpful?

  1. CalWin Script
  2. System script Events

OnSetSileDividersPos

This event occurs when calculating sile divider positions. One can determine positions for the sile divider by running through horizontal and vertical sile divider and set position based on for example product code and number of sile divider.

Example and syntax

const
  //G03
  cG03_TOP = 220.0;
  cG03_BOTTOM = 220.0;
  cG03_MIDDLE = 190.0;
  cG03_SIDES = 135.0; 
  
procedure OnSetSileDividersPos(aDoorLeaf:TSileDoorLeafWrapper);
var
  vHori,vVert:TSileDividerWrapper;
  vPos:extended;
  vHeight,vWidth:extended;
  i:integer;
begin 
  vHeight := aDoorLeaf.Height; 
  vWidth := aDoorLeaf.Width;
  if (aDoorLeaf.VariantItem.S1 = 'MA G03') then 
  begin
    //Horizontal
    for i := 0 to aDoorLeaf.HorizontalCount - 1 do
    begin
      vHori := aDoorLeaf.Horizontals[i];
      vPos := 0;
     
      //Num from bottom to top. Pos from top 
      case vHori.Num of 
        4 : vPos := cG03_TOP - (vHori.Width/2);
        3 : vPos := (vHeight/2) - (cG03_MIDDLE/2) + (vHori.Width/2);
        2 : vPos := (vHeight/2) + (cG03_MIDDLE/2) - (vHori.Width/2);
        1 : vPos := vHeight - cG03_BOTTOM + (vHori.Width/2);
      end;
      
      if vPos <> 0 then //Position from top of inner sash area
        vPos := vPos - aDoorLeaf.TopElement.Width;
      vHori.Position := vPos;
    end;  
    
    //Vertical
    for i := 0 to aDoorLeaf.VerticalCount - 1 do
    begin
      vVert := aDoorLeaf.Verticals[i];
      vPos := 0;
     
      //Num from right to left. Pos from left 
      case vVert.Num of 
        2 : vPos := cG03_SIDES - (vVert.Width/2);
        1 : vPos := vWidth - cG03_SIDES + (vVert.Width/2);
      end;
      
      if vPos <> 0 then //Position from left of inner sash area
        vPos := vPos - aDoorLeaf.LeftElement.Width;
      vVert.Position := vPos;
    end;  
  end;
  
  //other doorleafs...  
end;
PreviousOnSetElementJointTypeNextOnSetTranMullDesignCode

Last updated 2 years ago

Was this helpful?