May 06, 2024, 01:52:44 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Opening window ontop of other window

Started by billhsln, March 22, 2008, 09:49:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

I am opening a window on top of my main window.  The problem is that when I close the second window it leaves residue on the main window.  I looked for a REDRAW command, no such luck.  Is there an easy way to reset the main screen or am I just out of luck?

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

I need to see some code.
It should take care of itself unless you're using @noredraw or some-such.

I open windows on top of other windows all the time and don't have that problem.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Here is my code, this is the 100 Draw Poker program that I have been working on.  This is about 98% done.  To see my problem, click on the Big Red Button Twice.  Should say "Play", then switch to "Draw".  When displaying "Draw" it will have an open window on top.  Just click on "Play" again and it will go away.  That is when I have the left over stuff showing.  You can just keep clicking on the RED button to switch in and out.  You could even try playing the game, DRAW buttons switch to HOLD and the program does pretty much work.  I need to add a few refinements, but also everything works.

Thanks for taking a look,
Bill
When all else fails, get a bigger hammer.

LarryMc

What appears to be causing the problem is the GROUPBOX controls generated at line 125.

The command line itself looks okay (the groupbox doesn't have a bunch of options.

If you comment out line 125 the residual mess goes away.

I don't know what is causing it therefore I don't know how to fix it.

Couple of comments about window w2:
Usually you don't keep recreating the same window in a program.
You can create it once with its controls up where you create w1.
Immediately after creating it use the SHOWWINDOW command to hide it.

Then when you want to show it again you can use SHOWWINDOW again to show it(after updating the text).
Then the red button could hide it again.

Or, you could create a dialog one time and use the showdialog/closedialog commands to accomplish the same thing.

Also, I would be use to seeing w2 as a child window of w1 instead of a separate parent window.

Maybe Paul or Sapero will know what the deal is with the groupbox thing.

If I was just wanting to press on I'd try replacing the groupbox with a RECTANGLE and a @static control.; but you really shouldn't have to resort to that.

Sorry I couldn't be of more help.

BTW, why does 50 of the 100 groups go blank when the popup window comes up?

Larry

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Bruce Peaslee

Running the program as-is does not reproduce the problem. When the window closes there is no residue. A lot of the boxes do clear, however, as noted above. I'm running Vista on my laptop (no option). I can try it again on another machine when I get the chance.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

Bruce,

I'm running XP SP2 and duplicate it exactly as Bill described.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

I tried using a DIALOG, but that would require an action in the DIALOG, which I don't want.

I turned off the GroupBox, but I need them to make it look right.

I switched the w2 to be created at the same time as w1 and made it dependent on w1.  I also show and hide it using SHOWWINDOW command.  This works ok, but still leaves me with the residual colors showing up.

I tried resetting the GROUPBOX's colors, that did not work the way I need it to.  I tried resetting the entire screen (SETWINDOWCOLOR w1,WHITE), cleaned out the cyan area where the cards are displayed and I want the cards to be highlighted so they can be seen easily.  I know I could redraw the box, but the SETWINDOWCOLOR also left residual stuff on the screen.

As to blanking out the top half.  Look at the Edit Box, "Number of Decks to Play" and you will see it says 51.  Change that to 100 and it will use all.  Change it to 1 and it will only display the Cards.  It allows any number between 1 and 100, if you enter over 100 I force 100.

So far, I may just have to live with the colors showing up.  Especially since the program works pretty much like I want it to.  Will need to get used to having colors where I don't expect them.

Thanks for the suggestions.  I did try them.  Will keep plugging along.

Thanks again,
Bill
When all else fails, get a bigger hammer.

Ionic Wind Support Team

Group boxes are dialog-only controls, they will not work correctly in a window.  Group boxes have a non-drawing background area so they can be overlayed on top of controls and allow the controls to show through the "center" area.

They are still a rectangular window though, and a normal Emergence window will clip out the areas below any controls when drawing, so drawing commands don't overwrite on the top of the controls.  As a side effect the group box doesn't draw and the window doesn't draw in that area, so you get  "leftovers".

Use the RECT command and draw your own boxes if you need it in a window.

Quote
I tried using a DIALOG, but that would require an action in the DIALOG, which I don't want.

Care to elaborate?   Using the SHOWDIALOG command you can use a dialog just like a regular window, WAITUNTIL loop and all.   A dialog is specifically designed to be a container for controls, so there is always a solution.

Paul.
Ionic Wind Support Team

LarryMc

Quote from: Paul Turley on March 23, 2008, 09:43:36 PM
Group boxes are dialog-only controls,...

I had never come across that fact before.

I had even seen where this sort of problem had popped up in the old forums but I never found a reason.

Thanks

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Will try removing the GroupBoxes and doing them with the RECT command.

What I meant about the Dialogs not working the way I want.  It would require me to respond in some way to the Dialog.  Where as what I want to do is just keep clicking on my big RED button on the main window.

Thanks,
Bill
When all else fails, get a bigger hammer.

LarryMc

Quote from: billhsln on March 23, 2008, 11:17:31 PM
....  It would require me to respond in some way to the Dialog... 

first you use createdialog
then if you used showdialog and closedialog it would work just like you're doing with the window.

You're thinking of how we "normally" use dialogs with domodal.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library