It is currently Fri Sep 25, 2020 1:04 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Fri Oct 23, 2009 1:20 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jul 09, 2003 11:33 am
Posts: 306
Location: France
Hi,

I have big program, and sometime, i have this problem :

I don't see any icon in my ButtonImageGadget

I move mouse over my buttonimagegadget and icon come back (it's icon in buttonimagegadget, not image)

look this screen-shoot :
Image

It's sometime, i don't see raison for this moment, and i see this problem on XP on 3 different computers, and a have bug report for my program on my website about this

I just see all window refresh (small flash on window) and all icon disappear




Edit : I find how to see crash all time, I will try do to example with small code this evening

_________________
LSI


Last edited by Le Soldat Inconnu on Fri Nov 06, 2009 4:50 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5] buttonImageGadget refresh problem
PostPosted: Fri Oct 23, 2009 5:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jul 09, 2003 11:33 am
Posts: 306
Location: France
Hi,

i do example of problem

run this code

left click on treegadget

press down arrow on keyboard

and all image disappear in ButtonImageGadget :|

On XP SP3, need enable theme XP in compilation option

__________________________
Salut,

J'ai fait un exemple du problème

il faut :
- Exécuter le code
- Cliquer dans le treegadget (il est vide mais c'est pas grave)
- Presser la flèche bas sur le clavier

Et toutes les images des ButtonImageGadget ont disparu :|

Sous XP Sp3, avec Theme Xp activé dans les options de compilations

Code:
; Auteur : Le Soldat Inconnu
; Version de PB : 4.3
; Barre & Menu

;{- Paramètres
#Fenetre_L = 680
#Fenetre_H = 630
#Objet_Creer_Fenetre_L = 300
#Objet_Creer_Fenetre_H = 320
#Fenetre_B = 5
#Zone_Gerer_L = 160
#Zone_Editer_L = 230
#Zone_Apparence_L = 180

#Espace_V = 12
#Espace_H = 8
;}

Enumeration ; Gadgets et menus
   #Zone_Creer
   #Zone_Supprimer
   #Zone_Renommer
   
   #Zone_EditionApparence_Barre
   #Zone_EditionApparence_Menu
   
   #Onglet
   
   #Editer_Arbre
   #Editer_Element_Ajouter
   #Editer_Element_Supprimer
EndEnumeration

; Création d'une icone
Global Icone
Image = CreateImage(#PB_Any, 16, 16, 32)
StartDrawing(ImageOutput(Image))
   Box(0, 0, 10, 10, $FF00FF)
StopDrawing()
Icone = ImageID(Image)

; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, #Fenetre_L + 2 * #Fenetre_B, #Fenetre_H + 2 * #Fenetre_B, "Fenetre", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget | #PB_Window_Invisible) = 0
   End
EndIf

x = #Fenetre_B
y = #Fenetre_B

ButtonImageGadget(#Zone_Creer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Creer)
ButtonImageGadget(#Zone_Renommer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Renommer)
ButtonImageGadget(#Zone_Supprimer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Supprimer) + #Espace_V

x = #Fenetre_B + #Zone_Gerer_L + #Espace_H
y = #Fenetre_B
PanelGadget(#Onglet, x, y, #Fenetre_L - x + #Fenetre_B, #Fenetre_H - y + #Fenetre_B)

   AddGadgetItem(#Onglet, 0, "Onglet", Icone)
   Largeur = GetGadgetAttribute(#Onglet, #PB_Panel_ItemWidth) - #Fenetre_B * 2
   Hauteur = GetGadgetAttribute(#Onglet, #PB_Panel_ItemHeight) - #Fenetre_B * 2
   x = #Fenetre_B
   y = #Fenetre_B
   
   TreeGadget(#Editer_Arbre, x, y, Largeur - #Zone_Editer_L - #Espace_H, Hauteur, #PB_Tree_AlwaysShowSelection)
   x + Largeur - #Zone_Editer_L
   ButtonImageGadget(#Editer_Element_Ajouter, x, y, #Zone_Editer_L / 2, 28, Icone)
   ButtonImageGadget(#Editer_Element_Supprimer, x + #Zone_Editer_L - #Zone_Editer_L / 2, y, #Zone_Editer_L / 2, 28, Icone)
   
   AddGadgetItem(#Onglet, 1, "onglet 2", Icone)

   
CloseGadgetList()

; On affichage la fenêtre principale
HideWindow(0, 0)

Repeat
   Event = WaitWindowEvent(10)
   
   Select EventWindow()
         ;{- Fenêtre principale
      Case 0
         Select Event
            Case #PB_Event_CloseWindow
               Quitter = 1
         EndSelect
         ;}
   EndSelect
   
   
Until Quitter

End

_________________
LSI


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5] buttonImageGadget refresh problem
PostPosted: Fri Oct 23, 2009 6:50 pm 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8143
Location: Fort Nelson, BC, Canada
Confirmed here, same OS and version.

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5] buttonImageGadget refresh problem
PostPosted: Fri Oct 23, 2009 7:19 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10589
Location: Beyond the pale...
No problem on Vista. No problem on XP sp2 with PB 4.4 beta 3.

Confirmed though on XP sp 2 with PB 4.4 beta 5.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5] buttonImageGadget refresh problem
PostPosted: Fri Oct 30, 2009 1:44 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jul 09, 2003 11:33 am
Posts: 306
Location: France
it's do the same problem this PanelGadget, you select first panel tab with key "Tab", you press right key and images disappear

------------------
Pareil avec le panelgadget, tu le sélectionnes avec les touches Tab et tu changes d'onglet avec la flèche droite, les images disparaissent



___________________________________________________
Solution

I find solution, you catch event #WM_KeyDown to redraw window, like this

La solution est de détecter l'évènement #WM_KeyDown pour forcer la fenêtre a se redessiner, mais c'est pas terrible comme solution

Code:
; Auteur : Le Soldat Inconnu
; Version de PB : 4.3
; Barre & Menu

;{- Paramètres
#Fenetre_L = 680
#Fenetre_H = 630
#Objet_Creer_Fenetre_L = 300
#Objet_Creer_Fenetre_H = 320
#Fenetre_B = 5
#Zone_Gerer_L = 160
#Zone_Editer_L = 230
#Zone_Apparence_L = 180

#Espace_V = 12
#Espace_H = 8
;}

Enumeration ; Gadgets et menus
   #Zone_Creer
   #Zone_Supprimer
   #Zone_Renommer
   
   #Zone_EditionApparence_Barre
   #Zone_EditionApparence_Menu
   
   #Onglet
   
   #Editer_Arbre
   #Editer_Element_Ajouter
   #Editer_Element_Supprimer
EndEnumeration

; Création d'une icone
Global Icone
Image = CreateImage(#PB_Any, 16, 16, 32)
StartDrawing(ImageOutput(Image))
   Box(0, 0, 10, 10, $FF00FF)
StopDrawing()
Icone = ImageID(Image)

; Création de la fenêtre et de la GadgetList
If OpenWindow(0, 0, 0, #Fenetre_L + 2 * #Fenetre_B, #Fenetre_H + 2 * #Fenetre_B, "Fenetre", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget | #PB_Window_Invisible) = 0
   End
EndIf

x = #Fenetre_B
y = #Fenetre_B

ButtonImageGadget(#Zone_Creer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Creer)
ButtonImageGadget(#Zone_Renommer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Renommer)
ButtonImageGadget(#Zone_Supprimer, x, y, #Zone_Gerer_L, 28, Icone)
y + GadgetHeight(#Zone_Supprimer) + #Espace_V

x = #Fenetre_B + #Zone_Gerer_L + #Espace_H
y = #Fenetre_B
PanelGadget(#Onglet, x, y, #Fenetre_L - x + #Fenetre_B, #Fenetre_H - y + #Fenetre_B)
   
   AddGadgetItem(#Onglet, 0, "Onglet", Icone)
   Largeur = GetGadgetAttribute(#Onglet, #PB_Panel_ItemWidth) - #Fenetre_B * 2
   Hauteur = GetGadgetAttribute(#Onglet, #PB_Panel_ItemHeight) - #Fenetre_B * 2
   x = #Fenetre_B
   y = #Fenetre_B
   
   TreeGadget(#Editer_Arbre, x, y, Largeur - #Zone_Editer_L - #Espace_H, Hauteur, #PB_Tree_AlwaysShowSelection)
   x + Largeur - #Zone_Editer_L
   ButtonImageGadget(#Editer_Element_Ajouter, x, y, #Zone_Editer_L / 2, 28, Icone)
   ButtonImageGadget(#Editer_Element_Supprimer, x + #Zone_Editer_L - #Zone_Editer_L / 2, y, #Zone_Editer_L / 2, 28, Icone)
   
   AddGadgetItem(#Onglet, 1, "onglet 2", Icone)
   
   
CloseGadgetList()

; On affichage la fenêtre principale
HideWindow(0, 0)

Repeat
   Event = WaitWindowEvent(10)
   
   Select EventWindow()
         ;{- Fenêtre principale
      Case 0
         Select Event
            Case #PB_Event_CloseWindow
               Quitter = 1
            Case #WM_KEYDOWN
               RedrawWindow_(WindowID(0), 0, 0, #RDW_INTERNALPAINT)
         EndSelect
         ;}
   EndSelect
   
   
Until Quitter

End

_________________
LSI


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5] buttonImageGadget refresh problem
PostPosted: Sun Nov 01, 2009 3:21 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Dec 25, 2004 2:37 pm
Posts: 247
same Problem !

ImageGadget() run fine but not ButtonImageGadget()


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Fri Nov 06, 2009 4:51 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jul 09, 2003 11:33 am
Posts: 306
Location: France
pb4.40 b6 don't correct problem

_________________
LSI


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6, final] buttonImageGadget refresh problem
PostPosted: Fri Jan 15, 2010 10:32 am 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 191
Location: Munich
My programs also suffered under the mysteriously disappearing button imanges, and I finally found the cause. It is Windows' (infamous) "underlined letters for keyboard navigation" option:

XP: Display properties / Appearance / Effects..
last checkbox:
[ ] Hide underlined letters for keyboard navigation until I press the alt key

(This option is also responsible for the no-show of the dotted lines around focussed buttons and checkboxes.)

Under Vista/7 the option seems to be an accesibility feature.

Anyhow: PureBasic is doing something wrong here (since we cannot advise our software users to uncheck this option, and a refresh on #WM_KEYDOWN is only a work-around).

Maybe this helps to locate the bug.

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6, final] buttonImageGadget refresh problem
PostPosted: Sat Jan 16, 2010 6:03 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 191
Location: Munich
I found out that the button images disappear when the #LVN_KEYDOWN and #TVN_KEYDOWN notifications are processed by PureBasic for the first time.

BTW: The #WM_KEYDOWN work-around does not help, when a menu is opened by keyboard (like ALT+letter or ALT+space). So I made another work-around based on catching these notifications in the WindowCallback procedure.

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Mon Jul 29, 2013 5:21 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14090
Location: France
The problems seems to be gone, can anyone confirm ?


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Mon Jul 29, 2013 6:54 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 191
Location: Munich
I had removed the work-around after the problem seemed to have gone, but just a few days ago a user of my MemPad program (PB 5.11) reported the same issue again: When the window is restored from the system tray, the image button gadgets would disappear, but reappear when the mouse is moved over the buttons. XP/SP3.

I was unable to reproduce the quirk (XP, Win7), and asked the user for more details. No response yet.

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Tue Aug 13, 2013 8:40 am 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 191
Location: Munich
Fred wrote:
The problems seems to be gone, can anyone confirm ?

I have been able to reproduce the bug again: The ImageButtons only disappear when the window is restored after a #WM_HOTKEY event. Doing an UpdateWindow_() fixes the problem.

_________________
Horst.


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Tue Aug 13, 2013 10:30 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14090
Location: France
Do you have a small snippet showing the issue ?


Top
 Profile  
Reply with quote  
 Post subject: Re: [pb4.40 b5, b6] buttonImageGadget refresh problem
PostPosted: Tue Aug 13, 2013 1:58 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 28, 2003 6:57 am
Posts: 191
Location: Munich
Fred wrote:
Do you have a small snippet showing the issue ?

Sorry, I was not able to reproduce the issue with a simple window construct.

_________________
Horst.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye