Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 12 of 12 total
Thread Buttons not firing as expected !
Fri, Dec 22 2017 8:35 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 12/21/2017 12:37 PM, kamran wrote:
> URLList.Add(PrintBrowser.URL:='1xxxxxxxxxxxxxxxxxxxxxxxx');
> URLList.Add(PrintBrowser.URL:='2xxxxxxxxxxxxxxxxxxxxxxxx');
> URLList.Add(PrintBrowser.URL:='3xxxxxxxxxxxxxxxxxxxxxxxx');

This does not look right with assignment - did you mean to concatenate
the URL and string you provided ?  (URLList.Add(PrintBrowser.URL +
'3xxxxxxxxxxxxxxxxxxxxxxxx')



however here is a very quick unit of what i meant.

Form itself just has TBrowser and Button. Form has OnCreate and
OnDestroy event handlers and TBRowser has OnCall event handler.

You could just add URLs but calling public LoadURL function and
providing URL as parameter


=======================================

unit frmMain;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebBtns, WebBrwsr, WebEdits;

type

   TForm1 = class(TForm)
      Button1: TButton;
      Browser1: TBrowser;
      MultiLineEdit1: TMultiLineEdit;
      procedure Form1Create(Sender: TObject);
      procedure Form1Destroy(Sender: TObject);
      procedure Browser1Load(Sender: TObject);
   private
      URLList:TStringList;
      bBrowserLoading:boolean;
   public
      procedure LoadURL(const URLToLoad:string);
   end;

var
   Form1: TForm1;

implementation

procedure TForm1.Form1Create(Sender: TObject);
begin
   URLList := TStringList.Create;
   bBrowserLoading := false;
end;

procedure TForm1.Form1Destroy(Sender: TObject);
begin
   URLList.Free;
end;

procedure TForm1.LoadURL(const URLToLoad:string);
begin
   if bBrowserLoading then
      URLList.Add(URLToLoad)
   else
   begin
      bBrowserLoading := true;
      Browser1.URL := URLToLoad;
   end;
end;

procedure TForm1.Browser1Load(Sender: TObject);
begin
   if URLList.Count > 0 then
   begin
      Browser1.URL := URLList[0];
      URLList.Delete(0);
   end
   else
      bBrowserLoading := false;
end;

end.
Sat, Dec 23 2017 6:53 AMPermanent Link

kamran

Hi Raul

I will try this .

Really appreciate your help.

Merry Christmas !"

Cheers

Kamran

Raul wrote:

On 12/21/2017 12:37 PM, kamran wrote:
> URLList.Add(PrintBrowser.URL:='1xxxxxxxxxxxxxxxxxxxxxxxx');
> URLList.Add(PrintBrowser.URL:='2xxxxxxxxxxxxxxxxxxxxxxxx');
> URLList.Add(PrintBrowser.URL:='3xxxxxxxxxxxxxxxxxxxxxxxx');

This does not look right with assignment - did you mean to concatenate
the URL and string you provided ?  (URLList.Add(PrintBrowser.URL +
'3xxxxxxxxxxxxxxxxxxxxxxxx')



however here is a very quick unit of what i meant.

Form itself just has TBrowser and Button. Form has OnCreate and
OnDestroy event handlers and TBRowser has OnCall event handler.

You could just add URLs but calling public LoadURL function and
providing URL as parameter


=======================================

unit frmMain;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebBtns, WebBrwsr, WebEdits;

type

   TForm1 = class(TForm)
      Button1: TButton;
      Browser1: TBrowser;
      MultiLineEdit1: TMultiLineEdit;
      procedure Form1Create(Sender: TObject);
      procedure Form1Destroy(Sender: TObject);
      procedure Browser1Load(Sender: TObject);
   private
      URLList:TStringList;
      bBrowserLoading:boolean;
   public
      procedure LoadURL(const URLToLoad:string);
   end;

var
   Form1: TForm1;

implementation

procedure TForm1.Form1Create(Sender: TObject);
begin
   URLList := TStringList.Create;
   bBrowserLoading := false;
end;

procedure TForm1.Form1Destroy(Sender: TObject);
begin
   URLList.Free;
end;

procedure TForm1.LoadURL(const URLToLoad:string);
begin
   if bBrowserLoading then
      URLList.Add(URLToLoad)
   else
   begin
      bBrowserLoading := true;
      Browser1.URL := URLToLoad;
   end;
end;

procedure TForm1.Browser1Load(Sender: TObject);
begin
   if URLList.Count > 0 then
   begin
      Browser1.URL := URLList[0];
      URLList.Delete(0);
   end
   else
      bBrowserLoading := false;
end;

end.
Previous PagePage 2 of 2
Jump to Page:  1 2
Image