Table of Content
HAL Forum
procedure ControlLabel (
integer StartX,integer StartY,integer EndX,integer EndY,string Caption,
string FontName,integer TextStyle,integer Alignment,integer Color)
Description:
Creates text onto a touchscreen button, that has been defined with PictureButton. The coordinates for the label created are relevant to the coordinates of the button. Used inside WindowBegin/EndWindow block.
Parameters:
StartX The X coordinate of the upper left corner of the caption rectangle
StartY The Y coordinate of the upper left corner of the caption rectangle
EndX The X coordinate of the bottom right corner of the caption rectangle
EndY The Y coordinate of the bottom right corner of the caption rectangle.
Caption Text, that will be drawn on the Control that was created with PictureButton.
FontName Name of the font that will be used to draw the caption. (eg. SystemFont, Arial, Courier)
TextStyle Style of the caption. Will only work if the specified font supports it. (kTextStyleBold,kTextStyleNone,kTextStyleItalic).
Alignment Alignment of the caption. (AdjLeft,AdjCenter,AdjRight)
Color Color of the caption. (patM4black, patM4gray, patM4green, etc)
event DefineWindows
begin
  Real h,v,v1,v2,vm,vs,h2,hs,hof,es;
  Integer icn,icnovr,icndwn;
  
  SetLangMode(LangEnglish,"ENG",0);

  WindowBegin("Welcome",WelcomeWClass,CGother,RcType);
  SetWRect(80,170,788,536);
  UseView(RcVc);
  ToolBar;
  v1=257; v2 = 366; h = 0; hs = 238; h2 = 22;
  
  if (GuiType==kGuiCocoa) then begin
    AddBic(1052,1052,-1,0,ToolHomepage,0,"");
  end else begin
    PushButton(-150,10,-10,90,ToolHomepage,"\\im3120"); 
  end;
  EndToolBar;
  
  //WebPage(0,0,-1,255,"http://books.hansaworld.com/get-it-done-banner/hwindex.htm","");
  if (WindowsMode) then begin
    WebPage(0,0,-1,255,"res://" & ResourceFolder & "/get-it-done.html","");
  end else begin
    WebPage(0,0,-1,255,"file://" & HobFolder & "/../get-it-done.html","");
  end;
  
  if (WindowStyle(CurrentWindow)==kWindowStyleRedmond) then begin
    h2 = h2 - 10;
    icn = 3121;
    icndwn = 3122;
    icnovr = 3123;
  end else begin
    icn = 5030;
    icndwn = 5031;
    icnovr = 5032;
  end;
  
  PictureButton(h,v1,h+=hs,v2,icn,icndwn,icnovr,"","",ToolLocalDemo);
  ControlLabel(h2,15,238,30,"Demo Company","SystemFont",11,kTextStyleBold,AdjLeft,patM4black);
  ControlLabel(h2,40,238,55,"Use this company with sample","SystemFont",11,kTextStyleNone,AdjLeft,patM4dkGray);
  ControlLabel(h2,55,238,75,"data to get familiar with Books.","SystemFont",11,kTextStyleNone,AdjLeft,patM4dkGray);
  WindowLine(h+=1,v1+1,h,v2-1,kLineTypeGray);
  PictureButton(h+=1,v1,h+=hs,v2,icn,icndwn,icnovr,"WelcomeWClassNewInstall","",0);
  ControlLabel(h2,15,238,30,"New Installation","SystemFont",11,kTextStyleBold,AdjLeft,patM4black);
  ControlLabel(h2,40,238,55,"Start a new company from scratch or use","SystemFont",11,kTextStyleNone,AdjLeft,patM4dkGray);
  ControlLabel(h2,55,238,75,"the Books default settings.","SystemFont",11,kTextStyleNone,AdjLeft,patM4dkGray);
  WindowLine(h+=1,v1+1,h,v2-1,kLineTypeGray);
  BottomBar;
  CheckBox(20,-28,0,"Show on Startup",flags[0]);
  
  if (GetFirstCompany==-2) then begin
    HalPushButton(-280,-32,-160,-12,"DBUsageImportManually","Import backup");
  end else begin
    HalPushButton(-160,-32,-20,-12,"DBUsageExistingInstall","Existing Installation");
  end;
  
  EndWindow;
  return;
end;
Related topics:
««