In his initial effort author has mentioned that Lazarus needed patch 0014881 for OpenWire to work. I don't know current status since I use CodeTyphon 1.60 which comes with OpenWire prepackaged and ready for use. Components from OpenWire Help tutorial are in component pallete and ready to use. Component editors are buggy so you will end up with more manual coding then with Delphi, but OpenWire in general was usable in my 15 minutes initial test.
Openwire seems to be very powerful. I wonder what can be done with it.
Do you mean to make a 2D image generator with graphical editing embedded in Lazarus ?
Ok, so if I sumarize you are talking of two things :- one is making BGRA interface components, like Dibo started to do- second is to make BGRA "logical" components to plug with OpenWire, and to add plugs for interface components too.It's a good idea, if someone has the time to do this of course. I was also thinking about creating an easy scripting language for LazPaint.But first, I will have a look at openwire with CodeTyphon...
Thanks.Well, I was not thinking about graphical scripting, just a script language that would be easy to understand for a non programmer.
{ ****************************************************************** }{ }{ VCL component TMyClass }{ }{ Code generated by Component Create for Delphi }{ }{ Generated from source file c:\codetyphoon16\codetyphon\hiphiproject\compcreate1.cd }{ on 28 April 2011 at 14:18 }{ }{ A public domain component by the Ark Project }{ }{ ****************************************************************** }unit MyUnit;interfaceuses WinTypes, WinProcs, Messages, SysUtils, Classes, Controls, Forms, Graphics, Extctrls;type TMyClass = class(TPanel) private { Private fields of TMyClass } BGRABiasDivider : BGRABitmap; BGRAGridX : BGRAbitmap; BGRAGridY : BGRABitmap; BGRAHorizRuler : BGRAbitmap; BGRALinesX : BGRABitmap; BGRALinesY : BGRABitmap; BGRAVertRuler : BGRAbitmap; PnlMain : TPanel; { Private methods of TMyClass } { Method to set variable and property values and create objects } procedure AutoInitialize; { Method to free any objects created by AutoInitialize } procedure AutoDestroy; function GetFileBackground : TBitmap; procedure SetFileBackground(Value : TBitmap); function GetX_it : Integer; procedure SetX_it(Value : Integer); protected { Protected fields of TMyClass } BGRABackground : BGRAbitmap; PhiX : THiPhi; PhiY : THiPhi; { Protected methods of TMyClass } procedure Click; override; procedure KeyPress(var Key : Char); override; procedure Loaded; override; procedure Paint; override; public { Public fields and properties of TMyClass } { Public methods of TMyClass } constructor Create(AOwner: TComponent); override; destructor Destroy; override; published { Published properties of TMyClass } property OnClick; property OnDblClick; property OnDragDrop; property OnEnter; property OnExit; property OnKeyDown; property OnKeyPress; property OnKeyUp; property OnMouseDown; property OnMouseMove; property OnMouseUp; property OnResize; property FileBackground : TBitmap read GetFileBackground write SetFileBackground; property X_it : Integer read GetX_it write SetX_it; end;procedure Register;implementationprocedure Register;begin { Register TMyClass with Standard as its default page on the Delphi component palette } RegisterComponents('Standard', [TMyClass]);end;{ Method to set variable and property values and create objects }procedure TMyClass.AutoInitialize;begin BGRABackground := BGRAbitmap.Create(Self); BGRABackground.Parent := Self; with BGRABackground do begin { Left := } { Top := } Width := 640; Height := 200; Visible := True; end; BGRABiasDivider := BGRABitmap.Create(Self); BGRABiasDivider.Parent := Self; BGRAGridX := BGRAbitmap.Create(Self); BGRAGridX.Parent := Self; BGRAGridY := BGRABitmap.Create(Self); BGRAGridY.Parent := Self; BGRAHorizRuler := BGRAbitmap.Create(Self); BGRAHorizRuler.Parent := Self; BGRALinesX := BGRABitmap.Create(Self); BGRALinesX.Parent := Self; BGRALinesY := BGRABitmap.Create(Self); BGRALinesY.Parent := Self; BGRAVertRuler := BGRAbitmap.Create(Self); BGRAVertRuler.Parent := Self; PhiX := THiPhi.Create; PhiY := THiPhi.Create; PnlMain := TPanel.Create; with PnlMain do begin { Left := } { Top := } Width := 640; Height := 200; Visible := True end;end; { of AutoInitialize }{ Method to free any objects created by AutoInitialize }procedure TMyClass.AutoDestroy;begin BGRABackground.Free; BGRABiasDivider.Free; BGRAGridX.Free; BGRAGridY.Free; BGRAHorizRuler.Free; BGRALinesX.Free; BGRALinesY.Free; BGRAVertRuler.Free; PhiX.Free; PhiY.Free; PnlMain.Free;end; { of AutoDestroy }function TMyClass.GetFileBackground : TBitmap;begin { Return the BGRABackground.Tbitmapfile property } Result := BGRABackground.Tbitmapfile;end;procedure TMyClass.SetFileBackground(Value : TBitmap);begin { Set the BGRABackground.Tbitmapfile property } BGRABackground.Tbitmapfile := Value;end;function TMyClass.GetX_it : Integer;begin { Return the BGRAGridX.GridX_it property } Result := BGRAGridX.GridX_it;end;procedure TMyClass.SetX_it(Value : Integer);begin { Set the BGRAGridX.GridX_it property } BGRAGridX.GridX_it := Value;end;{ Override OnClick handler from TPanel }procedure TMyClass.Click;begin { Call method of parent class } inherited Click;end;{ Override OnKeyPress handler from TPanel }procedure TMyClass.KeyPress(var Key : Char);begin { Call method of parent class } inherited KeyPress(Key);end;constructor TMyClass.Create(AOwner: TComponent);begin inherited Create(AOwner); AutoInitialize; { Code to perform other tasks when the component is created }end;destructor TMyClass.Destroy;begin AutoDestroy; inherited Destroy;end;procedure TMyClass.Loaded;begin inherited Loaded; { Perform any component setup that depends on the property values having been set }end;procedure TMyClass.Paint;begin { Make this component look like its parent component by calling its parent's Paint method. } inherited Paint; { To change the appearance of the component, use the methods supplied by the component's Canvas property (which is of type TCanvas). For example, } { Canvas.Rectangle(0, 0, Width, Height); }end;end.
Hmm... Some things are not correct.Field declarations should be "... : TBGRABitmap"I'm not sure what it means, but I suppose Filebackground should be a TBGRABitmap instead of TBitmap and use Assign and Duplicate methods.
If you come up with something, please tell us.Well, I've tried OpenWire with CodeTyphon, but it was buggy. When there was more than 3 components, it would not work correctly anymore.
CompCreate HelpEdit | Add data linkData link propertiesWhen you select this menu item, you will first be asked whether you wish to add a data link that is read-only (for database browsing) or read-write (for database editing). You will then choose the names for the data link object and for the data source and data field properties associated with the data link. If the data link you are adding is the first one in the component, you will see "DataSource" and "DataField" supplied as the default property names. Data link event handlersYou will also choose the names for the method or methods that will act as event handlers for the data link. Default method names will be provided. If a method does not already exist, Component Create will generate it. If the data link is read-write, it will have event handling methods for OnDataChange, OnUpdateData, OnEditingChange, and OnActiveChange. If the data link is read-only, it will have only an OnDataChange event handler. These events are not events of your component, but events of the data link object that are handled within your component. For example, when the data in a field changes, the data link object fires an OnDataChange event. The method that you specify will be called in response to this event, where it presumably will change the appearance of your component (e.g., the Caption property of a label component).After you add the data link, you make your component interact with it by adding code to the method or methods that the Edit | Add data link menu item generated. Comments in the methods explain what to do depending on the nature of your component.You can add multiple data links by using the Edit | Add data link menu item more than once. A method can act as the event handler for more than one data link.Data link methodsIf you have added a read-write data link, you will also need to add references in your component to methods of the data link object. Wherever your component code may change the property or properties that correspond to the data field (e.g., the Text property of a data-aware edit box), you need to call the data link's Edit method beforehand to put the data link into editing mode and call its Modified method afterward to signal a change. For example, if the data link is named FDataLink, you would write:FDataLink.Edit;CodeToUpdateTheComponent;FDataLink.Modified;A data link object also has an UpdateRecord method that your component should call when it loses the focus (normally in its OnExit handler). Data links are objects of type TFieldDataLink, which is declared by the Visual Component Library in Dbtables.pas.For examples of code for data-aware components, see VCL source code file Dbctrls.pas and Component Create sample files Multfld.cd (label that links with multiple fields of a data source) and Dbunedit.cd (data-aware edit control with undo).Data field property editorsNormally, Delphi's Object Inspector provides a drop-down field list only for data field properties named "DataField" associated with a data source property named "DataSource." If the data field or data source property has another name, the developer must type the field name. To allow the developer to see a drop-down list of fields in the Object Inspector for a data field property with another name, component writers developing components with multiple data links need to register a custom property editor for each such data field property.To do so, select the data field property (whatever its name) on the Properties page and press the ">>>" button. Enter a property editor unit and class name. Then, generate the property editor unit with the Generate | Property editors menu item. Select "Drop-down list of data field names" as the property editor type.If your component's data source property has a name other than "DataSource," you will also need to edit the DataSourcePropName constant in the GetValues method of the generated property editor class.