Page 1 of 1
ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 12:19 am
by ricardo
Hi,
Im using a ScrollAreaGadget and using some imageGadget, but when i scroll it manually and moving back the images do not repaint and it dissapear.
Any help are wecome
Thanks
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 12:39 am
by ChrisR
ricardo wrote: Tue Nov 14, 2023 12:19 am
ARGENTINA WORLD CHAMPION
I won't answer because Leo Messi and his gang beat France in final, Na

Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 1:43 am
by ricardo
ChrisR wrote: Tue Nov 14, 2023 12:39 am
ricardo wrote: Tue Nov 14, 2023 12:19 am
ARGENTINA WORLD CHAMPION
I won't answer because Leo Messi and his gang beat France in final, Na
Then you will loose again with Argentina !!

Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 10:05 am
by ChrisR
Okay, I'm not going to lose 2 times, but without Messi's gold magic feet, it's going to be very hard for you in 2026, so enjoy it now
A big respect to him, he deserved to have a World Cup on his palmares.
For your trouble, it's difficult without a source to know what might be suitable.
If you're on Windows, maybe try with a
RedrawWindow function, with the right flags, maybe something like this:
Code: Select all
Procedure BindScrollArea()
If EventType() = 0
RedrawWindow_(GadgetID(#ScrollArea), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW)
EndIf
EndProcedure
.............
; ! SetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE) | #WS_CLIPCHILDREN)
BindGadgetEvent(#ScrollArea, @BindScrollArea())
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 5:11 pm
by ricardo
ChrisR wrote: Tue Nov 14, 2023 10:05 am
Okay, I'm not going to lose 2 times, but without Messi's gold magic feet, it's going to be very hard for you in 2026, so enjoy it now
A big respect to him, he deserved to have a World Cup on his palmares.
For your trouble, it's difficult without a source to know what might be suitable.
If you're on Windows, maybe try with a
RedrawWindow function, with the right flags, maybe something like this:
Code: Select all
Procedure BindScrollArea()
If EventType() = 0
RedrawWindow_(GadgetID(#ScrollArea), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW)
EndIf
EndProcedure
.............
; ! SetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE) | #WS_CLIPCHILDREN)
BindGadgetEvent(#ScrollArea, @BindScrollArea())
Thank you. Works!! with a little 'flickering' in the images when moving the scrool, it is not 100% smooth.
**Calm down, wait... in one or two generations you will be able to see France win again. Because Argentina is not only Messi, sorry for opening your eyes.
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 6:15 pm
by ricardo
Im not sure about this
Code: Select all
! SetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE) | #WS_CLIPCHILDREN)
I tried to run it inad get a prompt about ilegal assembler error.
Then is used
Code: Select all
SetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE) | #WS_CLIPCHILDREN)
I tried in 5.72 and 6.00 PB versions and get some error in both.
And it works, but with some flickering.
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 6:30 pm
by ChrisR
ricardo wrote: Tue Nov 14, 2023 5:11 pm
**Calm down, wait... in one or two generations you will be able to see France win again. Because Argentina is not only Messi, sorry for opening your eyes.
Yes, of course, it's not just Messi in Argentina, there was also Maradona, the fabulous Tango and my favorite shampoo ushuaïa

And,..... also the best soccer player in the world Messi, without him as a driving force, it's dead, sorry also
Code: Select all
SetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#ScrollArea), #GWL_STYLE) | #WS_CLIPCHILDREN)
It was commented with a ! because I don't know whether it's useful or not but it should work normally.
For flickering, there may be a need for
WM_SETREDRAW but I don't know where it should be added ?
Code: Select all
SendMessage_(GadgetID(#ScrollArea), #WM_SETREDRAW, #False, 0)
....
SendMessage_(GadgetID(#ScrollArea), #WM_SETREDRAW, #True, 0)
RedrawWindow_(GadgetID(#ScrollArea), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW)
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 8:54 pm
by ricardo
ChrisR wrote: Tue Nov 14, 2023 6:30 pm
Code: Select all
SendMessage_(GadgetID(#ScrollArea), #WM_SETREDRAW, #True, 0)
RedrawWindow_(GadgetID(#ScrollArea), #Null, #Null, #RDW_INVALIDATE | #RDW_ERASE | #RDW_ALLCHILDREN | #RDW_UPDATENOW)
Great man !! This works for the flicker as far as i tried. Thanks so much.
---------------------
About you other comments... im worried about your mental healt.
To begin with, I would advise you to brush your teeth when you say wrong things about the GREAT Argentine National Team.
You are missing a large number of players to mention, for example our goalkeeper is a hero and Di Maria is a genius, De Paul, Mc Allister and many others.
Continuing with the traditional humility that characterizes Argentines, I am going to ask you that when you mention those names you stand up please
Did Di Maria make French people suffer? Yes, I'm sorry. But he cant stop for making goals.
PS: Argentina did not have to 'import' players to win. They are all gauchos born in the Argentine Pampas, where Tango and Soccer are lived as a religion... and speaking of religion, even the Pope is Argentine. Be careful what you say, Francisco can look at this chat and send you to the pugatory ha ha
---------------------
Once again, thank you so much!!
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 9:08 pm
by ricardo
If a create dinamically images on ther scroll area, flickering comes back

Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Tue Nov 14, 2023 10:44 pm
by ChrisR
ricardo wrote: Tue Nov 14, 2023 8:54 pm
About you other comments... im worried about your mental healt.
To begin with, I would advise you to brush your teeth when you say wrong things about the GREAT Argentine National Team.
You are missing a large number of players to mention, for example our goalkeeper is a hero and Di Maria is a genius, De Paul, Mc Allister and many others.
Continuing with the traditional humility that characterizes Argentines, I am going to ask you that when you mention those names you stand up please
Did Di Maria make French people suffer? Yes, I'm sorry. But he cant stop for making goals.
PS: Argentina did not have to 'import' players to win. They are all gauchos born in the Argentine Pampas, where Tango and Soccer are lived as a religion... and speaking of religion, even the Pope is Argentine. Be careful what you say, Francisco can look at this chat and send you to the pugatory ha ha
I'll let you have the last word, after all you've won.
Fully agree about Di Maria, he was very appreciated when he played in France.
As for goalkeeper Martínez, he was very good at the World Cup, but unfortunately for him, the image that remains here is this one. The coke he'd taken must not have been very fresh.

Not sure Pope Francisco appreciates too! well, we'll do purgatory together.
For the dynamic images, I don't know, WM_SetRedraw and RedrawWindow_() often do the trick for flicker, but it's not always easy on Windows.
Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Wed Nov 15, 2023 7:45 am
by ricardo
Well, since in France they started playing soccer very few years ago, maybe weeks ha ha or at least, they were not known, maybe they have a distorted opinion.
The opinion that anyone who watches the World Cup coldly should remember goalkeeper Martínez as a great goalkeeper. His achievements in stopping penalties, in the World Cup and in the Copa America against Brazil, have been legendary.
In general, there are a large number of Argentine players who shine in their different leagues.
This is sure that Pope Francis applauded the final match and I know it because he is a well-known soccer fan, he is a fan of the San Lorenzo club.
I believe that the Pope should kick the ball well, like every Argentinian.
Maybe you can hire him as technical director of the French team

Re: ScrollAreaGadget Repaint ImageGadget?
Posted: Sat Jan 13, 2024 10:48 am
by Mesa
Im using a ScrollAreaGadget and using some imageGadget, but when i scroll it manually and moving back the images do not repaint and it dissapear.
It shouldn't because imagegadget as canvasgadget are persistant, like that:
Tested on
WIndows, images do not disapear:
Code: Select all
If OpenWindow(0, 0, 0, 405, 240, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScrollAreaGadget(0, 10, 10, 390,220, 575, 575, 30)
x=10
y=10
For i=1 To 8
CreateImage(i, 32,32,24,#White)
StartDrawing(ImageOutput(i))
Box(0,0,32,32,RGB(Random(255),Random(255),Random(255)))
StopDrawing()
ImageGadget(i,x,y,32,32,ImageID(i))
x=x+42
StopDrawing()
Next i
CloseGadgetList()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ForEver
EndIf
Code: Select all
If OpenWindow(0, 0, 0, 405, 240, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ScrollAreaGadget(0, 10, 10, 390,220, 575, 575, 30)
CanvasGadget (1, 0, 0, 575, 575)
CloseGadgetList()
x=10
y=10
For i=0 To 8
CreateImage(i, 32,32,24,#White)
StartDrawing(ImageOutput(i))
Box(0,0,32,32,RGB(Random(255),Random(255),Random(255)))
StopDrawing()
StartDrawing(CanvasOutput(1))
DrawImage(ImageID(i),10+x,y)
x=x+42
StopDrawing()
Next i
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
EndSelect
ForEver
EndIf
Mesa.