🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.migration
Article #64

Delphi to BCB help needed

#64
From: CN
Date: Wed, 15 Dec 2004 08:56
118 lines
3833 bytes
Hi!

I have been trying to translate the GSC QB Delphi code (from  
http://www.gsc.hu). I thought it was merely a task of syntax translation.  
Having found its complexity, I am about to abort the whole job after 30  
hours' work. Before making the painful decision, hopefully someone can  
help solving the following issues so that I can luckly finish it.

Thank you very very much!
CN

---Problem 1---
Delphi:

WndProc(var Message: TMessage);
begin
   with TWMKey(Message) do //The BCB equivalence?
   DoDropDownKeys(CharCode, KeyDataToShiftState(KeyData)); //The BCB  
equivalence?
   //do more stuff
end;

What are the equivalent BCB statements for these two Delphi statements?

with TWMKey(Message) do
DoDropDownKeys(CharCode, KeyDataToShiftState(KeyData));

---Problem 2---
Delphi:

procedure TGSCQBTable.WMMove(var Message: TWMMove);
begin
   inherited;
   //do more stuff
end;

where TGSCQBTable inherites from TForm.

void __fastcall TGSCQBTable::WMMove(TWMMove &Message)
{ TForm::WMMove(Message); //compiler complains:
   //TWinControl::WMMove(TWMMove &) is not accessible
}

The workaround?

---Problem 3---
Delphi:

procedure TGSCQBInplaceEdit.DropDown;
begin
   FPickList.Color := Color;
   FPickList.Font := Font;
   FPickList.Height := ...;
   Windows.SetFocus(Handle);
end;

TGSCQBInplaceEdit inherites from TInplaceEdit.
FPickList inherites from TCustomListBox.

BCB:

void __fastcall TGSCQBInplaceEdit::DropDown(void)
{ FPickList->Color=...; //Compiler complains: 'TControl::Color' is not  
accessible
   //Same access problem at these properties or event:
   FPickList->Font=...
   FPickList->Height=...
   FPickList->IntegralHeight=...
   FPickList->ItemHeight=...
   FPickList->OnMouseUp=... //an event
}

Help needed:

(1) Any solution for above properties/event access problem?
(2) What is the equivalent statement to the following Delphi? What is  
"Windows"?

Windows.SetFocus(Handle);

---Problem 3---
Delphi:

procedure TGSCQBInplaceEdit.WMCancelMode(var Message: TMessage);
begin
   StopTracking;
   inherited;
end;

void __fastcall TGSCQBInplaceEdit::WMCancelMode(TMessage &Message)
{
   TInplaceEdit::WMCancelMode(Message);
//'_fastcall TControl::WMCancelMode(TWMNoParams &)' is not accessible
}

Same problem happens to these

TInplaceEdit::WMKillFocus(Message);
TInplaceEdit::WMLButtonDblClk(Message);

---Problem 4---

Delphi:

procedure TPopupListbox.CreateParams(var Params: TCreateParams);
begin
   inherited CreateParams(Params);
   with Params do
     WindowClass.Style := CS_SAVEBITS;
end;

BCB:

void __fastcall TPopupListbox::CreateParams(TCreateParams &Params)
{ inherited::CreateParams(Params);
   Params.WindowClass.Style=CS_SAVEBITS; //How to fix compiler error:
   //'Style' is not a member of 'tagWNDCLASSA'
}
Technical Details
Message-ID: <opsi1kgktwb1mo8h@develop.seiliki.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,9f1a134f5212d5bf,start
X-Google-Attributes: gid110f51,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.migration
Subject: Delphi to BCB help needed
Date: Wed, 15 Dec 2004 16:56:34 +0800
From: CN <nospam@fastmail.fm>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Message-ID: <opsi1kgktwb1mo8h@develop.seiliki.com>
User-Agent: Opera M2/7.54 (Linux, build 751)
NNTP-Posting-Host: 61.62.196.106
X-Trace: newsgroups.borland.com 1103100268 61.62.196.106 (15 Dec 2004 00:44:28 -0800)
Lines: 118
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail