Re: [fpc-pascal] Font reading library
Ah, if forgot to mention, this work is in FreeType2 as well. Darius On Apr 18, 2011, at 3:20 PM, Felipe Monteiro de Carvalho wrote: > On Tue, Apr 12, 2011 at 6:43 PM, Darius Blaszyk > wrote: >> Hi Felipe, >> Nice work. I have been playing with FreeType as well to have it render on >> OpenGL. For that I ported some code from the web and modified it slightly. >> The result is a bitmapped font for OpenGL. You can find the code >> here: >> http://scandraid.svn.sourceforge.net/viewvc/scandraid/src/branches/font/ >> Regards, Darius > > For me it proved less useful. I wanted to read the name of Face > objects, but it seams that this feature is only in TrueType 2 =( > > -- > Felipe Monteiro de Carvalho > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Message methods
ZeelandNet Webmail Hi, I'm trying to understand how message methods work in FPC. For this I created a simple app that shows a message. I also created a second (identical form) and I expected that all message methods related to MY_MESSAGE would be executed when I pressed either one or the other button. This did not happen however even when dispatching through the Application object. Can someone explain me please? Regards, Darius TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure MessageReceiver(var msg: TMsg); message MY_MESSAGE; private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); begin msg.MSGID := MY_MESSAGE; msg.Data := 'Hello World!'; Dispatch(msg); end; procedure TForm1.Button2Click(Sender: TObject); begin Form2.Show; end; procedure TForm1.MessageReceiver(var msg: TMsg); begin ShowMessage(msg.Data); end;___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Message methods
dhkblas...@zeelandnet.nl hat am 19. April 2011 um 17:48 geschrieben: > Hi, > > I'm trying to understand how message methods work in FPC. For this I created > a simple app that shows a message. I also created a second (identical form) > and I expected that all message methods related to MY_MESSAGE would be > executed when I pressed either one or the other button. This did not happen > however even when dispatching through the Application object. Can someone > explain me please? > > Regards, Darius Make sure TMsg starts with TMsg = record MsgID: DWord; ... > > > > TForm1 = class(TForm) > Button1: TButton; > Button2: TButton; > procedure Button1Click(Sender: TObject); > procedure Button2Click(Sender: TObject); > procedure MessageReceiver(var msg: TMsg); message MY_MESSAGE; > private > { private declarations } > public > { public declarations } > end; > var Form1: TForm1; > implementation > {$R *.lfm} > { TForm1 } > procedure TForm1.Button1Click(Sender: TObject); > begin > msg.MSGID := MY_MESSAGE; > msg.Data := 'Hello World!'; > Dispatch(msg); > end; > procedure TForm1.Button2Click(Sender: TObject); > begin > Form2.Show; > end; > procedure TForm1.MessageReceiver(var msg: TMsg); > begin > ShowMessage(msg.Data); > end; > Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Message methods
On Apr 19, 2011, at 6:04 PM, Mattias Gaertner wrote: > > > > dhkblas...@zeelandnet.nl hat am 19. April 2011 um 17:48 geschrieben: > >> Hi, >> >> I'm trying to understand how message methods work in FPC. For this I created >> a simple app that shows a message. I also created a second (identical form) >> and I expected that all message methods related to MY_MESSAGE would be >> executed when I pressed either one or the other button. This did not happen >> however even when dispatching through the Application object. Can someone >> explain me please? >> >> Regards, Darius > > > Make sure TMsg starts with > > TMsg = record > MsgID: DWord; > ... I used a cardinal instead, so no issues there, although I expected to get two messages as I have two forms open (code for both identical to the code shown below). Instead when I dispatch the message only the class which dispatches the message receives it. The other class never does. So how is the message handler traversing the classes within the process? I must be missing something obvious. Darius >> >> >> TForm1 = class(TForm) >> Button1: TButton; >> Button2: TButton; >> procedure Button1Click(Sender: TObject); >> procedure Button2Click(Sender: TObject); >> procedure MessageReceiver(var msg: TMsg); message MY_MESSAGE; >> private >> { private declarations } >> public >> { public declarations } >> end; >> >> varForm1: TForm1; >> >> implementation >> >> {$R *.lfm} >> >> { TForm1 } >> >> procedure TForm1.Button1Click(Sender: TObject); >> begin >> msg.MSGID := MY_MESSAGE; >> msg.Data := 'Hello World!'; >> Dispatch(msg); >> end; >> >> procedure TForm1.Button2Click(Sender: TObject); >> begin >> Form2.Show; >> end; >> >> procedure TForm1.MessageReceiver(var msg: TMsg); >> begin >> ShowMessage(msg.Data); >> end; >> > > > Mattias > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Message methods
will it really traverse the classes ? from what i understood about the manual (and i heavily use that mechanism) it will only trigger the class where you dispatch to, so, self.dispatch(msg) only works for the TForm. if you need more than that you will need to traverse the component tree yourself. but this is not trully hard to do with tcomponents. but i may be wrong... 2011/4/19 Darius Blaszyk : > > On Apr 19, 2011, at 6:04 PM, Mattias Gaertner wrote: > > > > > > dhkblas...@zeelandnet.nl hat am 19. April 2011 um 17:48 geschrieben: > > Hi, > > I'm trying to understand how message methods work in FPC. For this I created > a simple app that shows a message. I also created a second (identical form) > and I expected that all message methods related to MY_MESSAGE would be > executed when I pressed either one or the other button. This did not happen > however even when dispatching through the Application object. Can someone > explain me please? > > Regards, Darius > > > > Make sure TMsg starts with > > > > TMsg = record > MsgID: DWord; > ... > > I used a cardinal instead, so no issues there, although I expected to get > two messages as I have two forms open (code for both identical to the code > shown below). Instead when I dispatch the message only the class which > dispatches the message receives it. The other class never does. So how is > the message handler traversing the classes within the process? I must be > missing something obvious. > Darius > > > TForm1 = class(TForm) > Button1: TButton; > Button2: TButton; > procedure Button1Click(Sender: TObject); > procedure Button2Click(Sender: TObject); > procedure MessageReceiver(var msg: TMsg); message MY_MESSAGE; > private > { private declarations } > public > { public declarations } > end; > > var Form1: TForm1; > > implementation > > {$R *.lfm} > > { TForm1 } > > procedure TForm1.Button1Click(Sender: TObject); > begin > msg.MSGID := MY_MESSAGE; > msg.Data := 'Hello World!'; > Dispatch(msg); > end; > > procedure TForm1.Button2Click(Sender: TObject); > begin > Form2.Show; > end; > > procedure TForm1.MessageReceiver(var msg: TMsg); > begin > ShowMessage(msg.Data); > end; > > > > Mattias > > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal