|
DavidCrow wrote: How are you adding the pages to the sheet?
like this.... any ideas ??
BOOL CTabSettings::OnInitDialog()
{
CDialog::OnInitDialog();
m_sheet.AddPage(&m_page0);
m_sheet.AddPage(&m_page1);
m_sheet.AddPage(&m_page2);
m_sheet.AddPage(&m_page3);
m_sheet.AddPage(&m_page4);
m_sheet.AddPage(&m_page5);
m_sheet.AddPage(&m_page6);
m_sheet.Create(this, WS_CHILD | WS_VISIBLE , 0);
m_sheet.ModifyStyleEx (0, WS_EX_TRANSPARENT);
m_sheet.ModifyStyle( 0, WS_TABSTOP );
m_sheet.SetActivePage(0);
m_sheet.SetWindowPos( NULL, 0, 0, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );
.........
|
|
|
|
|
Can we say that class/objects in C++ implicitly supports state based programmming?
|
|
|
|
|
What do you mean exactly ? Can you be more specific ?
You still can have a kind of 'state machine' in a class if you want to. I don't really understand what you are asking for.
|
|
|
|
|
well let me explain,
Say I have a class
Class SunLight{
public:
bool state;
void set_state(bool state_value)
{
state=state_value;
}
};
Here I am have function which changes the data member value of my class. So in general I am changing the state of my class.
in C language I can do same using procedure programming but where I need to explicly declare and hold/preserve variables and manuipulate by passing those variables to function.I think this extra burden on programmer.
finally Such kind of implementation can ne implemented as shown above in C++ using classes. So can we say that for state based system my class are useful and efficient, hence the argument "C++ classes implicilty supports state based programming".
-- modified at 4:54 Friday 21st April, 2006
|
|
|
|
|
|
My sole intension was to validate the thing I put here...If there is any conceptual missunderstanding , u may please state here.
|
|
|
|
|
You can see things as 'encapsulation' also: it is a little bit the same concept. Each object retains its state (that is not directly accessible for the external world) and you can modify it by the use og public functions.
I think it's the same as what you said.
|
|
|
|
|
i still don't understand the whole thing you expllain/ask for (if ever), but if you use a bool, then your object will have only 2 states : ON/OFF, enabled/disabled, true/false...
so, i'd suggest you (once you"ll need to emulate a much bigger state machine), to use an enum which defines one flag per state...
|
|
|
|
|
... or use the "state design pattern", which can be implemented in any OO language.
|
|
|
|
|
can anybody tell abt the VB's chr() equivalent in VC++?
|
|
|
|
|
Please when asking things like that, explain what the function does. I'm not at all familiar with VB so I needed to check in the MSDN for the function. It looks like this function returns the char associated with an ASCII number, am I right ?
There is no need to call a function in C++, just cast your integer into a char and that will do the trick:
char NewChar = (char)65;
|
|
|
|
|
Thanks for ur help! i tried the same way. But as i am not sure of correctness, i placed here.Thanks once again
|
|
|
|
|
in VC++ there is no need for the conversion...
in vb
Dim MyChar As Char
MyChar = Chr(65) ' Returns "A".
in vc++
char MyChar = 65;
is enough
nave
|
|
|
|
|
Yes, but to avoid a warning because you are converting from int to char (possible loss of data), make the casting explicit:
char MyChar = (char)65;
-- modified at 4:51 Friday 21st April, 2006
|
|
|
|
|
|
Cedric Moonen wrote: char MyChar = (int)65;
you wanted to say (char) , didn't you ?
|
|
|
|
|
Yes, of course... Friday morning, end of week, brain tired, wanna go home ![Poke tongue | ;-P](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_tongue.gif)
|
|
|
|
|
ok... so, as i'm not in the lounge, what do you do this wkend ? ![Laugh | :laugh:](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_laugh.gif)
|
|
|
|
|
Maybe start working on my article . You convinced me that it's time.
Otherwise, maybe going out for a little walk (I think the weather will be nice on sunday), receiving friends, spend time with my girlfriend, ... Already heavily loaded
And what about you ?
And what about VisualCalc3 ? ![Smile | :)](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Cedric Moonen wrote: Maybe start working on my article
ahh, good news !!
what will it be about ?
Cedric Moonen wrote: And what about you ?
little wkend...
this evening, party at a coleague, so i wont sleep a lot.
saturday : sleep sleep sleep (and code, to entertain the fingers )
sunday : i referee a rugby match at about 360kms (one way only - ) from home, so, wont be there neither...
monday, let's go again for a one more run
Cedric Moonen wrote: And what about VisualCalc3 ?
sources and article done... submitting this wkend
|
|
|
|
|
v2.0 wrote: what will it be about ?
A charting control. It's been ages that I developped it, but never had the time to make an article (or, I always delayed it ).
v2.0 wrote: and code, to entertain the fingers
What about playing guitar, to entertain the fingers also
v2.0 wrote: sources and article done... submitting this wkend
Cool, I'll have a look at it ![Wink | ;)](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_wink.gif)
|
|
|
|
|
hi,
whr r u u guys from? i'm from india.
|
|
|
|
|
i'm from another planet than earth, but Cedric is from Belgium (looking at his CP profile...)
|
|
|
|
|
What u guys have done with my thread...
nave
|
|
|
|
|
Some relaxation is needed...
- NS -
|
|
|
|