Difference between revisions of "User:LRChampagne2k"

From Lazarus wiki
Jump to navigationJump to search
Line 9: Line 9:
 
# Gain an understanding of the implementation of the "wiki-style" pages structure, syntax and style.
 
# Gain an understanding of the implementation of the "wiki-style" pages structure, syntax and style.
  
<code>
 
unit TestQueueAsyncCall;
 
  
{$mode objfpc}{$H+}
+
unit TestQueueAsyncCall;
 
+
{$mode objfpc}{$H+}
interface
+
uses
+
interface
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
+
uses
  StdCtrls;
+
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
 
+
  StdCtrls;
type
+
type
  { TQueueAsyncCallForm }
+
  { TQueueAsyncCallForm }
  TQueueAsyncCallForm = class(TForm)
+
  TQueueAsyncCallForm = class(TForm)
    CallButton: TButton;
+
    CallButton: TButton;
    LogListBox: TListBox;
+
    LogListBox: TListBox;
    procedure CallButtonClick(Sender: TObject);
+
    procedure CallButtonClick(Sender: TObject);
 
+
  private
  private
+
    { private declarations }
    { private declarations }
+
    FCounter: PtrInt;
    FCounter: PtrInt;
+
    procedure Async(Data: PtrInt);
    procedure Async(Data: PtrInt);
+
  public
 
+
    { public declarations }
  public
+
  end;  
    { public declarations }
+
  end;  
+
  var
 
+
  QueueAsyncCallForm: TQueueAsyncCallForm;
var
+
  QueueAsyncCallForm: TQueueAsyncCallForm;
+
implementation
 
+
{ TQueueAsyncCallForm }
implementation
+
{ TQueueAsyncCallForm }
+
procedure TQueueAsyncCallForm.CallButtonClick(Sender: TObject);
 
+
begin
procedure TQueueAsyncCallForm.CallButtonClick(Sender: TObject);
+
  LogListBox.Items.Add('Click 1');
begin
+
  FCounter := FCounter+1;
  LogListBox.Items.Add('Click 1');
+
  Application.QueueAsyncCall(@Async,FCounter);
  FCounter := FCounter+1;
+
  LogListBox.Items.Add('Click 2');
  Application.QueueAsyncCall(@Async,FCounter);
+
end;
  LogListBox.Items.Add('Click 2');
+
end;
+
procedure TQueueAsyncCallForm.Async(Data: PtrInt);
 
+
begin
procedure TQueueAsyncCallForm.Async(Data: PtrInt);
+
    LogListBox.Items.Add('Async '+ IntToStr(Data));
begin
+
end;
  LogListBox.Items.Add('Async '+ IntToStr(Data));
+
{$R *.lfm}
end;
+
 
+
end.
{$R *.lfm}
 
 
 
end.
 
 
 
</code>
 
--[[User:LRChampagne2k|LRChampagne2k]] 14:58, 17 April 2014 (CEST)
 
  
 
''-end-''
 
''-end-''
 +
--[[User:LRChampagne2k|LRChampagne2k]] 05:10, 18 April 2014 (CEST)

Revision as of 05:10, 18 April 2014

Just JUNK that may be DELETED, at any time

Purpose:

Its purpose is multi-, as follows:

  1. A basic understanding of the syntax, structure, capabilities and limitations of Wiki editing.
    1. Attempts to mix Wiki-style and HTML-style editing (The former is new to me; the latter I am not fond of.)
    2. I'd PREFER to fully edit off-line, and port to the proper pages,
  2. Gain an understanding of the implementation of the "wiki-style" pages structure, syntax and style.


unit TestQueueAsyncCall;
{$mode objfpc}{$H+}

interface
uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
  StdCtrls;
type
  { TQueueAsyncCallForm }
  TQueueAsyncCallForm = class(TForm)
    CallButton: TButton;
    LogListBox: TListBox;
    procedure CallButtonClick(Sender: TObject);
  private
    { private declarations }
    FCounter: PtrInt;
    procedure Async(Data: PtrInt);
  public
    { public declarations }
  end; 

 var
  QueueAsyncCallForm: TQueueAsyncCallForm;

implementation
{ TQueueAsyncCallForm }

procedure TQueueAsyncCallForm.CallButtonClick(Sender: TObject);
begin
  LogListBox.Items.Add('Click 1');
  FCounter := FCounter+1;
  Application.QueueAsyncCall(@Async,FCounter);
  LogListBox.Items.Add('Click 2');
end;

procedure TQueueAsyncCallForm.Async(Data: PtrInt);
begin
   LogListBox.Items.Add('Async '+ IntToStr(Data));
end;
{$R *.lfm}

end.

-end- --LRChampagne2k 05:10, 18 April 2014 (CEST)