Bug in modal dialog

Post Reply
User avatar
Enrico Maria Giordano
Posts: 8753
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 4 times
Contact:

Bug in modal dialog

Post by Enrico Maria Giordano »

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

#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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Bug in modal dialog

Post by byte-one »

It seems, that in a nomodal-dialog the first control looses the background color!?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 42512
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Bug in modal dialog

Post by Antonio Linares »

Enrico,

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

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42512
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Bug in modal dialog

Post by Antonio Linares »

This code seems to be the right one:

Code: Select all | Expand

        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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Bug in modal dialog

Post by byte-one »

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

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
Antonio Linares
Site Admin
Posts: 42512
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Bug in modal dialog

Post by Antonio Linares »

Günther,

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

Code: Select all | Expand

        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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Bug in modal dialog

Post by byte-one »

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
Contact:

Re: Bug in modal dialog

Post by byte-one »

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
Antonio Linares
Site Admin
Posts: 42512
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: Bug in modal dialog

Post by Antonio Linares »

Günther,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Bug in modal dialog

Post by Rimantas »

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.
Post Reply