BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi to C++

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Sabetay Toros
Guest





PostPosted: Sat Apr 14, 2007 12:18 am    Post subject: Delphi to C++ Reply with quote



I'll appreciate very much if someone can translate the following Delphi
code to C++.

Thanks
Sabetay

var
TBXTheme: TTBXTheme;
M: TMessage;
begin
TBXTheme := GetTBXTheme('SpectrumXP');
with TTBXSpectrumXPTheme(TBXTheme) do
begin
WindowCl := clGreen;
HighlightCl := clLime;
BtnFaceCl := clGreen;
BtnShadowCl := clGreen;
BtnHighlightCl := clGreen;
HighlightTextCl := clGreen;
BtnTextCl := clLime;
GrayTextCl := clLime;
MenuTextCl := clLime;
WindowFrameCl := clTeal;
WindowTextCl := clLime;
end;
M.Msg := TBX_SYSCOMMAND;
M.WParam := TSC_VIEWCHANGE;
M.LParam := 0;
M.Result := 0;
TBXTheme.Dispatch(M);
TBXSetTheme('SpectrumXP');
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Apr 14, 2007 12:32 am    Post subject: Re: Delphi to C++ Reply with quote



"Sabetay Toros" <bilsarbiz (AT) ttnet (DOT) net.tr> wrote in message
news:461fd7e9$1 (AT) newsgroups (DOT) borland.com...

Quote:
I'll appreciate very much if someone can translate the
following Delphi code to C++.

{
TTBXTheme *TBXTheme = GetTBXTheme("SpectrumXP");

TTBXSpectrumXPTheme *XPTheme =
static_cast<TTBXSpectrumXPTheme*>(TBXTheme);
XPTheme->WindowCl = clGreen;
XPTheme->HighlightCl = clLime;
XPTheme->BtnFaceCl = clGreen;
XPTheme->BtnShadowCl = clGreen;
XPTheme->BtnHighlightCl = clGreen;
XPTheme->HighlightTextCl = clGreen;
XPTheme->BtnTextCl = clLime;
XPTheme->GrayTextCl = clLime;
XPTheme->MenuTextCl = clLime;
XPTheme->WindowFrameCl = clTeal;
XPTheme->WindowTextCl = clLime;

TMessage M;
M.Msg = TBX_SYSCOMMAND;
M.WParam = TSC_VIEWCHANGE;
M.LParam = 0;
M.Result = 0;
TBXTheme->Dispatch(&M);
TBXSetTheme("SpectrumXP");
}


Gambit
Back to top
Clayton Arends
Guest





PostPosted: Sat Apr 14, 2007 12:34 am    Post subject: Re: Delphi to C++ Reply with quote



This is a literal translation:

TTBXTheme* TBXTheme = GetTBXTheme("SpectrumXP");
TTBXSpectrumXPTheme* spectrumTheme =
static_cast <TTBXSpectrumXPTheme*> (TBXTheme);
spectrumTheme->WindowCl = clGreen;
spectrumTheme->HighlightCl = clLime;
spectrumTheme->BtnFaceCl = clGreen;
spectrumTheme->BtnShadowCl = clGreen;
spectrumTheme->BtnHighlightCl = clGreen;
spectrumTheme->HighlightTextCl = clGreen;
spectrumTheme->BtnTextCl = clLime;
spectrumTheme->GrayTextCl = clLime;
spectrumTheme->MenuTextCl = clLime;
spectrumTheme->WindowFrameCl = clTeal;
spectrumTheme->WindowTextCl = clLime;

TMessage M;
M.Msg = TBX_SYSCOMMAND;
M.WParam = TSC_VIEWCHANGE;
M.LParam = 0;
M.Result = 0;
TBXTheme->Dispatch(M);

TBXSetTheme("SpectrumXP");

You can optionally change the first two lines to this one line:

TTBXSpectrumXPTheme* spectrumTheme =
static_cast <TTBXSpectrumXPTheme*> (GetTBXTheme("SpectrumXP"));

.... and then change the dispatch line to:

spectrumTheme->Dispatch(M);

- Clayton
Back to top
Clayton Arends
Guest





PostPosted: Sat Apr 14, 2007 12:35 am    Post subject: Re: Delphi to C++ Reply with quote

Quote:
TBXTheme->Dispatch(M);

Whoops, this line should have been:

TBXTheme->Dispatch(&M);

- Clayton
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.