Startseite ¦  was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews ¦  sonstiges
kylix ¦  tutorials ¦  online shop ¦  fotos ¦  Add&Win Gewinnspiel


Willkommen Gast. Bitte einloggen oder registrieren.
21.05.2012, 11:59:48
Übersicht Hilfe Suche Einloggen Registrieren

+  SwissDelphiCenter Forum
|-+  English Forums
| |-+  General Forum
| | |-+  Calling function/procedure or events in "post" mod
« vorheriges nächstes »
Seiten: [1] Drucken
Autor Thema: Calling function/procedure or events in "post" mod  (Gelesen 2468 mal)
rch
Gast
« am: 03.08.2002, 18:51:14 »

Hi, i've a little question for all:
can i call a function/procedure or an event in Delphi in "post" mode ?

For example i wish to realize:
procedure TForm1.FormCreate(Sender: TObject);
begin
  instruction1...;
  instruction2...;
  instruction3...;
  // now i post a call: function or event were called AFTER all
  // instruction in FormCreate; in fact there are queued at the end of "my"
  // Window queue...
  posting a call to MyFunction (or MyEvent)...;
  instruction4...;
  instruction5...;
end;

for whom know Sybase PowerBuilder is like:
...
...
MyObject.Event Post MyEvent([params])
MyObject.Event Post MyFunction([params])
...
...

i'm sorry for my "very bad" english...
thank you very much for any answer...

bye, Roby
Gespeichert
AXMD
Sr. Member
****
Offline Offline

Beiträge: 385



WWW
« Antworten #1 am: 03.08.2002, 20:12:40 »

Hi,

would you possibly be so kind as to explain a little more waht you want to realize?

AXMD
Gespeichert

rch
Gast
« Antworten #2 am: 04.08.2002, 14:27:28 »

An example when i use this tecnique is in the open event in a form:

Suppose i have to extract a lot of data from database at the open in my form only (FormCreate event), for example to populate a listbox.
I can't see the form until the extraction is completed, but if i could "post" the retrieve, the FormCreate finish because the retrieve is called AFTER, in post mode.

Unfortunatly i can only show an example in PowerBuilder:

FormCreate:
.
.
.
// initialize the form...
// ...code that init the form...

// --- retrieving data...

// in traditional mode i have to extract data here...
MyForm.MyFunctionToExtractData()
// or
MyForm.Event MyEventToExtractData()
// in this way:
// 1 init the form
// 2 retrieve data
// 3 the form become visible


// in post mode i post that in the Window queue...
MyForm.Post MyFunctionToExtractData()
// or
MyForm.Event Post MyEventToExtractData()
// in this way:
// 1 init the form
// 2 the form become visible
// 3 retrieve data

.
.
.

I use this "posting" mode also for syncronize some list (Master/Detail):
suppose you have 2 list with some rows (in PowerBuilder there are called DataWindow).
There is an event (RowFocusChanged) that's fired when i move from a row to an other one in a DataWindow;
in this event (on the first list) i can exctract detail data in the second list.
If i call the second-list retrieve in syncron-mode each time i move on the first list i have to wait for terminating the second extraction;
if i call the second-list retrieve in post-mode i can move in the first list and the retrieve is posted on the Windows queue after the moving.

// Syncron mode: RowFocusChanged event on the first list:
DataWindowDetail.Retrieve()
// in this way:
// 1 i move the focus on new row (but i don't see the change)
// 2 retrieve data in second list
// 3 i see the focus on new row


// Asyncron mode: RowFocusChanged event on the first list:
DataWindowDetail.Post Retrieve()
// 1 i move the focus on new row (i see immediately the change!)
// 2 retrieve data in second list


In fact this tecnique uses the Windows API PostMessage (asyncron call) instead SendMessage (syncron call);
what i want is extend this calling (PostMessage) also for my procedure/function and my event.

Excuse me for my "orrible" english...

Thank you very much...bye
Gespeichert
Seiten: [1] Drucken 
« vorheriges nächstes »
Gehe zu:  


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Prüfe XHTML 1.0 Prüfe CSS