Silverfrost Forums

Welcome to our forums

ClearWin window with vscroll

28 Dec 2010 5:35 (Edited: 29 Dec 2010 8:10) #7302

Hi

The example user interface has a top and bottom box as shown in the figure below. The top box is for data input and the lower one for displaying the results. In the lower box is a clearWin window with a vertical scroll to display the results. It should be similar to the output window in the Plato IDE.

[URL=http://img530.imageshack.us/i/gui.gif/]http://img530.imageshack.us/img530/4773/gui.gif[/URL]

28 Dec 2010 5:45 #7303

The initial problem as explained above is fixed. Ragarding the lower box: The idea is to have a Clearwin window within a box. However, when I test the code it writes the results to a new Clearwin window (see figure below) and not the one defined in the code.

Question: What should I change in oder to direct the result to the desired window? The test code which produce the result in the figure is given at the end of this entry. [URL=http://img51.imageshack.us/i/enum.gif/]http://img51.imageshack.us/img51/8739/enum.gif[/URL] winapp program enum use mswin implicit none integer :: i,j,ctrl character(len =20):: string ctrl = -1 i=winio@('%ca[Enumarate fonts]&') i=winio@('%sy[thin_border]&') i=winio@('%bg[BTNFACE]&') i=winio@('%mn[E&xit]&','EXIT') ! Open a box i=winio@('%nl%ob[raised]&') i=winio@('Results %ff%nl&') ! Define a clearwin window i=winio@('%ob[depressed]%40.20cw[vscroll]%cb&',0) i=winio@('%lw&',ctrl) do j=1,1000 call get_font_name@(string,j) if (string /=' ') then print *,j,' [',string,'] ' else exit endif enddo i=winio@('%cb') end program enum

29 Dec 2010 3:37 #7306
winapp 
program enum 
   use mswin 
   implicit none 
   integer :: i,ctrl,liste
   ctrl = -1 
   i=winio@('%ca[Enumarate fonts]&') 
   i=winio@('%sy[thin_border]&') 
   i=winio@('%bg[BTNFACE]&') 
   i=winio@('%mn[E&xit]&','EXIT') 
   ! Open a box 
   i=winio@('%nl%ob[raised]&') 
   i=winio@('Results %ff%nl&') 
   ! Define a clearwin window 
   i=winio@('%ob[depressed]%40.20cw[vscroll]%cb&',6) 
   i=winio@('%lw%cb',ctrl)
   i=liste()
end

integer function liste()
   use mswin 
   implicit none 
   integer :: j
   character(len =20):: string 
   do j=1,1000 
      call get_font_name@(string,j) 
      if (string /=' ') then 
         write(6,'(I4,A5,A20,A5)')j,'    [',string,']   ' 
      else 
         exit 
      endif 
   enddo 
   liste = 1
end

Best regards, Wilfried

29 Dec 2010 4:26 #7307

Hi Wilfried

thanks for your help! I think I understand now how to do this: 1.) define the fortran_unit (6 in this case) 2.) close the box which contains the ClearWin window after %lw, i.e. %lw%cb 3.) then call the function which output the results.

The posted code now produces the desired result.

[URL=http://img80.imageshack.us/i/redirectz.gif/]http://img80.imageshack.us/img80/3721/redirectz.gif[/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

Please login to reply.