Clearing the entire Window!!

Hi everybody,

I have some frames being displayed on the default window, i need to clear all the frames on click of some buton...

Do we have something like clear screen option or what else can be done for that???

Can anyone help me out??? :confused:
 
How about:

clear frame name-of-frame.

Depending on the content of the frame you might have to do some additional work to reset everything. (radiosets, toggles etc..).

Casper.
 
Code:
def var a as char initial "a" no-undo.
def var b as char initial "b" no-undo.
def button btn_clear label "Clear Frames".
form a btn_clear with frame a.
form b with frame b.
on choose of btn_clear in frame a do:
  clear frame a.
  clear frame b.
end.
display a with frame a.
display b with frame b.
enable all with frame a.
enable all with frame b.

wait-for window-close of current-window focus btn_clear.
hide frame a.
hide frame b.
 
Hi,

Got the answer for my question...
thanks a lot. but onething "clear frame frame-name" ---> clears the information on the frame but doesnt hide the frame... Hide is the one which i need, but if i have 3 frames on display i have to write hide for these three frames.

Dont we have a single command which clears the entire screen by hiding all the frames which r in display???

something like clearscreen in DOS or in language like C which clears the entire screen and keeps it fresh.
 
You could try HIDE ALL.

But, be careful. If you are using a WAIT-FOR that refers to a frame and then you use HIDE ALL then you will get an error.

So, in the example above:
wait-for go of a in frame a focus btn_clear.

results in the error "FRAME used in WAIT-FOR statement is not VISIBLE. WAIT-FOR terminated. (2910)" if you do a HIDE ALL when the button is pressed.

That's why I normally use WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW and use triggers for everything else.
 
If you create a window using the appbuilder you get a window with a default frame. You can put your own frames on top of this frame ( The default frame is the parent of your frames. When you hide the default frame then everything in it, including your frames will be hidden also.
 
Cooool, i can understand ur ideas. Thanks for sharing ur information with me...

I have done 7 different modules which has to be integrated into a single one with menu's. So when i click one thing a set of frames will be available and if i click another a set of frames will be available... So i have to clear all the frames when i am going to display click another menu-item...

Hope so u can get me...
 
Try this. There are 4 buttons (not 7), each of which shows different frames. Toggle Frames just moves between them. If you want more buttons or more frames or different combinations then add them.


Code:
def var framelist as char initial "set1,set2,set3,set4" no-undo.
def var frame_used as char no-undo.
def button btn_toggle label "Toggle Frames".
def button btn_set1 label "Set1".
def button btn_set2 label "Set2".
def button btn_set3 label "Set3".
def button btn_set4 label "Set4".
 
def frame fr_toggle btn_toggle btn_set1 btn_set2 btn_set3 btn_set4 with side-labels 1 down three-d.
def frame a "Frame a" with title "Frame a" row 5 col 10.
def frame b "Frame b" with title "Frame b" row 5 col 40.
def frame c "Frame c" with title "Frame c" row 7 col 10.
def frame d "Frame d" with title "Frame d" row 7 col 40.
on choose of btn_toggle in frame fr_toggle run p_toggle_frames.
on choose of btn_set1 in frame fr_toggle do:
  frame_used = "set1".
  run p_show_frames.
end.
on choose of btn_set2 in frame fr_toggle do:
  frame_used = "set2".
  run p_show_frames.
end.
on choose of btn_set3 in frame fr_toggle do:
  frame_used = "set3".
  run p_show_frames.
end.
on choose of btn_set4 in frame fr_toggle do:
  frame_used = "set4".
  run p_show_frames.
end.
enable all with frame fr_toggle.
wait-for window-close of current-window.
 
procedure p_toggle_frames:
  if frame_used = "" then frame_used = entry (1,framelist).
  else
  if lookup (frame_used,framelist) < num-entries (framelist) then
    frame_used = entry (lookup (frame_used,framelist) + 1,framelist).
  else 
    frame_used = entry (1,framelist).
  run p_show_frames.
end procedure.
procedure p_show_frames:
  case frame_used:
    when "set1" then do:
      hide frame c.
      hide frame d.
      view frame a.
      view frame b.
      enable all with frame a.
      enable all with frame b.
    end.
    when "set2" then do:
      hide frame a.
      hide frame b.
      view frame c.
      view frame d.
      enable all with frame c.
      enable all with frame d.
    end.
    when "set3" then do:
      hide frame a.
      hide frame c.
      view frame b.
      view frame d.
      enable all with frame b.
      enable all with frame d.
    end.
    when "set4" then do:
      hide frame b.
      hide frame d.
      view frame a.
      view frame c.
      enable all with frame a.
      enable all with frame c.
    end.
  end case.
 
end procedure.
 
I have done 7 different modules which has to be integrated into a single one with menu's. So when i click one thing a set of frames will be available and if i click another a set of frames will be available... So i have to clear all the frames when i am going to display click another menu-item...

[longwinded]
Well, I'd have one window per module. But assuming you have to have them all in the same window activated by triggers (as you suggest), a relatively simple way is to have one 'master' frame per module which contains the other frames for that module, and show and hide the master frame as required with one statement (example attached). This is slightly different to RKR's suggestion in that you create your own 'default frame' for each module. Alternatively, you could keep your module windows, and parent them to the Main Application window (getting complicated). This makes the assumption that frames are not shared between modules. If they are you will have to operate along sphipp's or other lines (eg. SmartObjects - but that's a whole other kettle of fish).
[/longwinded]

This is a quite normal way of showing related frame combinations, often operated by a tab component (eg. MS tabstrip).
 

Attachments

Hi Tom,

I don't suppose you just happen to have a nice little sample program that shows that tab strip interface handy? ;)

You'd need a registered-for-development version of the tabstrip ocx for the MS example (MSComCtl.ocx).

Although the ocx is a commonly deployed file (you'll probably find one in c:\windows\system32 on Windows), I believe you may need a license for MS Visual Studio, eg. VS6 to be able to use it for development in Progress.

To use OCXes you create your window, and click the OCX icon on the palette, and select the OCX you want to drop on the window, as any other widget (sorry if I'm stating the obvious to you).

Alternatively, if you have SmartObjects configured, they have their own non-OCX tabstrip (the folder object).

If you have either of the above configured, the attached files will demonstrate a simple example (created on Win XP SP2 Progress 9.1d07)
.

In place of the message boxes you would show/hide your frames/objects.

Close any files you have in Appbuilder before loading, as OCX can crash across Progess versions, but even if you just view the code, that should give some pointers.

[Logging off to go home from office :sleepy:]
 

Attachments

Thanks everyone...
I have got lot of informations from this thread and i like to thank u all, i have now integrated my modules successfully...

I like to specially thank Mr.KnutHandsome, who have given me lot of information on this and it was very easy for me when i was integrating the same... :)
 
Back
Top