Merging a child window in a parent window

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Merging a child window in a parent window

#1 Post by obelix »

:eusa-hand: Hi everybody
I need your help to dissolve two similar problems:
1. I read from a text file to a database by a fread() operation. The content of the every record should be shown in the window without
building a new window after every record (preventing a flickering window)
2. I want to show the result of a GET cvar VALID {||udfcontent(cvar)} operation in my existing window without rebuilding this window

Code: Select all

#include "dcdialog.ch"

 proc main
   cvar="0"
   cvar2="Content may be changed by udfcontent()"
   GetList := {}
   @ 10,5 DCSAY "Only for demonstration"
   @ 12,5 DCSAY "This is my parent window, which should not disappear during counting to 100 "
   // The next line should be displayed in a child window without hiding the parent window
   for x= 1 to 100
     @ 14,5 DCSAY "Just count to hundred "+ str(x)  // here should  be shown the content of a fread() operation or
                                                     // reading from a database from top to eof()  in a child window like 1,2 ..
   next
   // end of the child window
   //...
   //...
   @ 16,5 DCSAY cvar2

   //  the content of cvar2 should be changed by the function udfcontent and be displayed in the parent window
   @ 18,5 DCSAY "Show me the content of the function" get cvar valid  {||udfcontent(cvar),DC_GetRefresh(GetList)}
   ctitle=""
   DCREAD GUI  FIT ADDBUTTONS
   //
   return

   function udfcontent
   parameters cvar1
   if cvar1="1"
      cvar2="Content changed to 1"
   else
      cvar2="Content changed to 2"
   endif
   @ 16,5 DCSAY cvar2
   return (cvar1)

quiet old but still young and unskilled in express++

skiman
Posts: 1189
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Merging a child window in a parent window

#2 Post by skiman »

Hi,

I don't know what you really want to do, but instead of
@ 16,5 DCSAY cvar2

you should use
@ 16,5 DCSAY {|| cvar2 }

When it is a codeblock, it will be evaluated with a dc_getrefresh().

I would add a button which has an action to get the next line:
{|| x++ , udfcontent(x), dc_getrefresh(getlist) }
Each time you click on the button, the next line would appear.
Best regards,

Chris.
www.aboservice.be

User avatar
obelix
Posts: 48
Joined: Tue Dec 03, 2013 7:44 am
Location: Villingen-Schwenningen, Black Forest, Germany

Re: Merging a child window in a parent window

#3 Post by obelix »

Wow I couldn't believe it. It really works! Good advice for my second problem.
Thank you Chris!
quiet old but still young and unskilled in express++

Post Reply