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 

Re: How I translate this in C++ fom Delphi ?

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





PostPosted: Tue Jun 24, 2003 2:15 am    Post subject: Re: How I translate this in C++ fom Delphi ? Reply with quote




"Andrei Ariescu" <drin@k.ro> wrote

Quote:
No ... this is not what I want ...

What I want is :

typedef enum {goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine,
goRangeSelect, goDrawFocusSelected, goRowSizing, goColSizing, goRowMoving,
goColMoving, goEditing, goTabs, goRowSelect, goAlwaysShowEditor,
goThumbTracking} TGridOption;
typedef Set<TGridOption, goFixedVertLine, goThumbTracking> TGridOptions;

I know that "if goRowSelect in Options" is translated to if (
Options.Contains(goRowSelect) ), so how should I write " if [goRowSelect,
goEditing, goTabs] in Options " ????

Contains() only accepts single elements, so you could:

1) Use brute force:

if ( Options.Contains(goRowSelect) && Options.Contains( goEditing ) && ... )

2) or create a new Set containing the items you are looking for, do an
intersection between the sets, and see if the intersection is equal to the
new Set. This is untested code, but the basic idea behind it should be
correct:

// begin untested code

Set MySet;
// initialize MySet
MySet << goRowSelect << goEditing << goTabs;

// if this test is 'true', Options SHOULD contain goRowSelect, goEditing,
and goTabs
// (it might also contain other elements)
if ( (Options * MySet) == MySet ) ...

// end untested code

- Dennis




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.