Table of Content
HAL Forum
procedure DropDownMenu (
integer PosX,integer PosY,integer Length,string RecordField,integer SSetID)
Description:
Creates a dropdown menu that is linked to window record (defined with UseView/SetBlid) field and populated by the items from a specified string set (pre-defined with SetBegin/EndSet). Used inside WindowBegin/EndWindow block.
Parameters:
PosX The X coordinate of the upper left corner of the dropdown menu
PosY The Y coordinate of the upper left corner of the dopdown menu.
Length Length of the dopdown menu field
RecordField The name of the record field that is going to receive the selection value
SSetID The number of StringSet to use for creating the list
DropDownMenu(h+70,v,h+210,"RndDefaultCurStep",398);

event DefineWindows
begin
  real i,h,h1,h2,h3,h4,h5,h6,h7,hm,hs,v,l,vs,v2,vm,f,t,fs;
  
  SetLangMode(LangEnglish,"ENG",0);

  WindowBegin("Round Off",RoundTClass,CGSbl,RoundType);
  SetBlid(RoundBlock);
  if ValuePack(1) then begin
  SetWRect(64,80,609,580);
  end else begin
  SetWRect(64,80,609,345);
  end;
  v = 20; vs = 24; h = 170;
  
  ButtonFrame(h=40,vm=v,220,6,"Default");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndDefaultDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultDirec",400);
  
  v = vm;
  ButtonFrame(h=300,vm=v,220,6,"Default for Currency");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndDefaultCurDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultCurStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultCurMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndDefaultCurDirec",400);
  
  v = v + 60;
  
  ButtonFrame(h=40,vm=v,220,6,"Total");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndTotalDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndTotalStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndTotalMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndTotalDirec",400);
  
  v = vm;
  ButtonFrame(h=300,vm=v,220,6,"VAT");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndVATDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndVATStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndVATMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndVATDirec",400);

  if ValuePack(1) then begin  
  v = v + 60;
  
  ButtonFrame(h=40,vm=v,220,6,"Cost Price");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndCostDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndCostStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndCostMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndCostDirec",400);
  
  v = vm;
  ButtonFrame(h=300,vm=v,220,6,"Row Sum");
  EditField(h+70,v+=2,60,"Decimals",Normal,RndRowsumDecs,true,0);
  StaticText(h+68,(v+=vs) + 13,"Step",true);
  DropDownMenu(h+70,v,h+210,"RndRowsumStep",398);
  StaticText(h+68,(v+=vs) + 13,"Mode",true);
  DropDownMenu(h+70,v,h+210,"RndRowsumMode",399);
  StaticText(h+68,(v+=vs) + 13,"Direction",true);
  DropDownMenu(h+70,v,h+210,"RndRowsumDirec",400);
  
  v = v + 60;
  
  ButtonFrame(h=40,vm=v,150,2,"Discount Calculation");
  RadioButton(h,v,0,0,"Value Discount",Discount);
  RadioButton(h,v+=16,1,0,"Price Discount",Discount);
  
  v = vm;
  ButtonFrame(h=300,vm=v,150,2,"VAT Calculation");
  RadioButton(h,v,0,0,"Per VAT Code",VATCalcWay);
  RadioButton(h,v+=16,1,0,"Per Row",VATCalcWay);
  end;
  EndWindow;

  return;
end;

Related topics:
««