Bug in modal dialog

Bug in modal dialog

Postby Enrico Maria Giordano » Sun Dec 04, 2011 9:13 pm

Please run the following test and click on the window: you will see that the normal highlight color of the selection bar of the browse is not shown anymore (it was in the previous FWH release). It is gray instead:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    USE CUSTOMER

    DEFINE WINDOW oWnd

    ACTIVATE WINDOW oWnd;
             ON CLICK TEST()

    CLOSE

    RETURN NIL


STATIC FUNCTION TEST()

    LOCAL oDlg

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 1, 1 LISTBOX FIELDS

    ACTIVATE DIALOG oDlg;
             CENTER NOMODAL

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in modal dialog

Postby byte-one » Mon Dec 05, 2011 12:43 am

It seems, that in a nomodal-dialog the first control looses the background color!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Bug in modal dialog

Postby Antonio Linares » Mon Dec 05, 2011 9:38 am

Enrico,

This change is required in Class TDialog. Thanks! :-)

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in modal dialog

Postby Antonio Linares » Mon Dec 05, 2011 9:43 am

This code seems to be the right one:

Code: Select all  Expand view
        if ::Initiate()
            if Len( ::aControls ) >= 1
               ::aControls[ 1 ]:PostMsg( WM_SETFOCUS )
            endif
         endif
               
         ::Show()      
         ::Refresh() // needed for resource dialogs
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in modal dialog

Postby byte-one » Mon Dec 05, 2011 10:38 am

Antonio, thats not a good way. You see, the focus-color are not gone if leaving the get. And also the focus goes always return to the first control of the folderpage if i return from another folderpage.
As I say, this problem is only on NOWAIT-Dialogs!!
The problem of the bolded say on transparent dialogs is also visible in this testdialog!

Code: Select all  Expand view
function test()
 local oDlg, oFld, oGet, cCombo, cTest := "Hello world", cAnother := "Another GET"

SetGetColorFocus( CLR_BLUE )

   DEFINE DIALOG oDlg TITLE "Antonio Test" SIZE 400, 300 TRANSPARENT
   @ 1, 19 GET cTest OF oDlg COLOR CLR_HRED,CLR_GRAY
   @ 3, 5 FOLDEREX_ST oFld PIXEL PROMPT "&One", "&Two", "&Three" SIZE 140,120
   @ 1, 1 GET oGet VAR cTest OF oFld:aDialogs[ 1 ] COLOR CLR_HRED,CLR_GRAY
   @ 2, 1 COMBOBOX cCombo PROMPTS {"A","B","C"} OF oFld:aDialogs[ 1 ]
   @ 4, 1 GET cAnother OF oFld:aDialogs[ 1 ] COLOR CLR_HRED,CLR_GRAY
   @ 5, 1 SAY "Bolder.. , when TAB changes the focus goes in-/outside the folder" OF oFld:aDialogs[ 1 ]
   @ 7.2, 14 BUTTON "Ok" ACTION msginfo(;
   "BG-Color Get 1: "+str(oFld:aDialogs[ 1 ]:aControls[1]:nClrpane)+CRLF+CRLF+;
   "BG-Color Get 2: "+str(oFld:aDialogs[ 1 ]:aControls[3]:nClrpane);
   )
   ACTIVATE DIALOG oDlg CENTER //NOWAIT
return nil
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Bug in modal dialog

Postby Antonio Linares » Mon Dec 05, 2011 11:28 am

Günther,

This code satisfies Enrico's example and your example also:

Code: Select all  Expand view
        if ::Initiate()
            ::SetFocus()
         endif
 


Still we need to find why the first control is not getting the right color. Still I have to check the FixSays()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in modal dialog

Postby byte-one » Mon Dec 05, 2011 12:25 pm

Antonio, thanks!
I found, the bolder-effect on says are ONLY on TfolderEx NOT on Tfolder and ONLY on the first change outside from the folderex. If i change once from one folderdialog to another, the ugly effect is gone!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Bug in modal dialog

Postby byte-one » Tue Dec 06, 2011 12:52 pm

Still we need to find why the first control is not getting the right color.
Still I have to check the FixSays()

Any results, Antonio?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Bug in modal dialog

Postby Antonio Linares » Tue Dec 06, 2011 3:54 pm

Günther,

We are doing more tests to solve the pending issues
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42085
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Bug in modal dialog

Postby Rimantas » Tue Dec 06, 2011 6:04 pm

Antonio Linares wrote:Günther,
We are doing more tests to solve the pending issues


Antonio , I really don't know is that related , but in folderex created on dialog aren't working other languages , russian as sample . With folderex on windows it's working , but on dialogs not . So if I let prompts for folderex on dialog :

DEFINE DIALOG oDlg RESOURCE "DIALOG1"
REDEFINE FOLDEREX oFld1 ID 110 OF oDlg;
PROMPT "&Clipper", "&Виндовс" DIALOGS "Sub1", "Sub2"

It not will work ( second tab - in russian "Windows" ). Please , turn attention for that .

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 113 guests