Home » Community » Newbie corner » Question on a widget on top of a widget **BUG STATEMENTS NOT COMPLETED BEFORE NEXT STATEMENT
Re: Question on a widget on top of a widget [message #33288 is a reply to message #33287] |
Fri, 22 July 2011 17:02   |
silverx
Messages: 62 Registered: March 2011
|
Member |
|
|
Thanks for the information, but it still didn't work.
What is the difference between .Hide and .Show(false)?
That is what I was using. The other thing is all items where added from layout and not from any code. Why should that make any difference?
I would prefer to build it in Layout instead of in code, if possible.
But if I do set it in code I need to set the size and position with .SetRect, is the x and y based upon the item it is added to?
Also I tried your code, but changing from App to T5, Code is:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
class T5:public TopWindow {
typedef T5 CLASSNAME;
Button b;
EditString e;
public:
T5(){
b.SetLabel("Click me!"); //set the button text
Add(b.HCenterPos(100).VCenterPosZ(30)); //add button to the window
b.Add(e.HCenterPos(80).VCenterPos(20)); //add editfield to the button,
//positioning is relative to the button
b<<=THISBACK(SwitchEdit); // assign function to the button click
e.Hide(); // hide the editfield initialy
}
void SwitchEdit(){
e.Show(!e.IsShown()); // switch the visibility
}
};
GUI_APP_MAIN{
T5().Sizeable().Run();
}
And I get the following error:
t5: 1 file(s) built in (0:02.35), 2356 msecs / file, duration = 2356 msecs, parallelization 0%
Linking...
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C:\upp\out\MSC9.Debug.Debug_full\t5.exe : fatal error LNK1120: 1 unresolved externals
There were errors. (0:02.88)
In addition I tried to do the add of the object in my code to my program, and just set position and FrameSet so I could see it. When I execute the code it does show up, but then when I start using it, it never comes back. The only way it shows up is if I do a PromptOK after I do the .Show.
I did the add in code using the following. It is for my own widget, that I have defined, after button.
W1.Add(E1.HCenterPos(10).VCenterPos(10));
W2.Add(E2.HCenterPos(10).VCenterPos(10));
E1.SetFrame(BlackFrame());
E2.SetFrame(BlackFrame());
I am using a image in the both cases, I just want the second image to show up for about 1 second then hide it again on top of the other image.
I think it is a bug on Windows Vista.
|
|
|
Goto Forum:
Current Time: Sun Sep 07 13:44:49 CEST 2025
Total time taken to generate the page: 0.06555 seconds
|