Page 5 of 11

Posted: Thu Apr 26, 2007 9:11 pm
by AND51
SmartWindowRefresh(#WindowID, Flag) is an other method. It helps to prevent the window from flickering when it's resized.

And this resizing can be done manually or by your lib.

I can imagine, that many coders are using your fantastic ResizeLib, but some of them (like me) might wonder, why their window is flickering. They try to solve this problem, but don't know how. It would be nice, if you could write down this clue into your manual.


> and the lib went out long before
All (or most) of your libs were created with PB 3.94 or earlier, I know. But you must go ahead. Stay updated with your PB 4.x libs! If there are new possibilities (like the idea with #PB_Ignore for your ResizeLib), then use those possibilities!!!!

You think your lib is great? Ha, if you would implement more tricky functions like my idea with #PB_Ignore, then your lib wouldn't be great... IT WOULD BE BRILLIANT!!!! :wink:

Posted: Fri Apr 27, 2007 7:35 am
by gnozal
AND51 wrote:SmartWindowRefresh(#WindowID, Flag) is an other method. I can imagine, that many coders are using your fantastic ResizeLib, but some of them (like me) might wonder, why their window is flickering. They try to solve this problem, but don't know how. It would be nice, if you could write down this clue into your manual.
Sure, but I can't recommend what I haven't tested, and SmartWindowRefresh() is an official PB function, so it's in the manual ...
But I will test this and if it works well, I will add a line in the help file.

Posted: Fri Apr 27, 2007 12:34 pm
by AND51
Image

Posted: Fri Apr 27, 2007 3:14 pm
by AND51
Your update is bad!

Bug found!
Click and hold the upper^l eft< corner of the window to resize it. Now move it the the lower V right > corner: It resizes the window into the wrong direction!


I'll send you a video-link again (via PM)... Please, correct this error ASAP. I need to finish my program until monday.
If you can't correct this mistake, then give me the previous version of this lib it's better than the current one.

For the video: Please tell me, if you can extract 7z-Archives... Then I can compress the video to <300 KB. Otherweise, I must use ZIP insetad!


h.a.n.d., AND51

Posted: Fri Apr 27, 2007 4:11 pm
by gnozal
AND51 wrote:Your update is bad!

Bug found!
Click and hold the upper^l eft< corner of the window to resize it. Now move it the the lower V right > corner: It resizes the window into the wrong direction!
Please test http://freenet-homepage.de/gnozal/PureRESIZE_BETA.zip

Posted: Fri Apr 27, 2007 5:18 pm
by gnozal
Update (both lib versions)

Changes :

- fixed 'manual upperleft corner resize + set minimal size' resize bug

Posted: Fri Apr 27, 2007 5:31 pm
by AND51
yeah, now it's fixed!

thx!! :D

Posted: Fri Oct 05, 2007 2:13 pm
by gnozal
Update (both versions)

Changes :

- enhanced PureRESIZE_SetGadgetResize(GadgetNumber.l, ...)
Parameter GadgetNumber now also may be a valid Windows control handle, this allows to use the library with 'API gadgets' created with CreateWindowEx_().
I needed it for a project.

Posted: Sun Oct 07, 2007 8:45 am
by electrochrisso
Thanks for your libs, they are great. :D

Posted: Tue Jan 15, 2008 3:24 pm
by gnozal
Update

Changes :
- fixed a 'minimal size' resize bug
Also recompiled PureFORM : this should fix the 'minimum window size' bug reported by tinman in preview mode.

Posted: Tue Jan 15, 2008 11:23 pm
by tinman
Hi gnozal :)

A couple of requests.

1) Is it possible to have the unicode version of the library within the normal UserLibrary rather than having to set the subsystem? It's something I missed the first time and means I have to remember to set two things for unicode on each source. User libraries should be able to have unicode specific commands if they are called <Command>_UNICODE() and the library is passed through "libmaker" with the /UNICODE switch.

Would it be possible to have a resizing system where you can have 2 (or more) gadgets that resize or move side by side (e.g. OK and Cancel at the bottom of a dialog)? If PureResize can do this I have not figured it out. I use a library at work that allows you to set how much the left, top, right and bottom egdes of a gadget change by when a window is resized (float between 0 and 1). You can get normal "anchor" behaviour using 0's and 1's but you can also have multiple adjacent resizing elements using values in between.

Posted: Wed Jan 16, 2008 8:55 am
by gnozal
tinman wrote:Is it possible to have the unicode version of the library within the normal UserLibrary rather than having to set the subsystem?
It is possible, but it's so much easier when using tailbite to compile separate libraries. I have so much librairies / versions that I am not sure to change this.
And it's fully transparent to the user with jaPBe V3.
tinman wrote:Would it be possible to have a resizing system where you can have 2 (or more) gadgets that resize or move side by side (e.g. OK and Cancel at the bottom of a dialog)?
Although I don't understand exactly what you mean, sounds like a complicated request :wink:

Posted: Wed Jan 16, 2008 1:57 pm
by tinman
gnozal wrote:
tinman wrote:Is it possible to have the unicode version of the library within the normal UserLibrary rather than having to set the subsystem?
It is possible, but it's so much easier when using tailbite to compile separate libraries. I have so much librairies / versions that I am not sure to change this.
And it's fully transparent to the user with jaPBe V3.
OK.
gnozal wrote:
tinman wrote:Would it be possible to have a resizing system where you can have 2 (or more) gadgets that resize or move side by side (e.g. OK and Cancel at the bottom of a dialog)?
Although I don't understand exactly what you mean, sounds like a complicated request :wink:
OK, what about instead of completely anchoring to an edge, how about partially anchoring to an edge. So instead of a gadget moving by 1 pixel when the edge is moved, it moves by e.g. 0.5 of a pixel?

The bad thing is you'd need to store the current position/size of each gadget and that sounds like code you'd need to add :)

Posted: Wed Jan 16, 2008 2:13 pm
by gnozal
Sorry Tinman, I still don't get what you want.
About your Ok/Cancel example, have a look at the codes below :
Example 1

Code: Select all

Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Button_Cancel
  #Button_Ok
EndEnumeration
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 195, 165, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_Cancel, 0, 135, 65, 30, "Cancel")
      ButtonGadget(#Button_Ok, 130, 135, 65, 30, "Ok")
      PureRESIZE_SetGadgetResize(#Button_Cancel, 1, 0, 0, 1)
      PureRESIZE_SetGadgetResize(#Button_Ok, 0, 0, 1, 0)
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0()

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #Window_0
          CloseWindow(#Window_0)
          Break
      EndSelect
  EndSelect
Forever
Example 2

Code: Select all

Enumeration 
  #Window_0 
EndEnumeration 
Enumeration 
  #Button_Cancel 
  #Button_Ok 
EndEnumeration 
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 195, 165, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_Cancel, 60, 135, 65, 30, "Cancel")
      ButtonGadget(#Button_Ok, 130, 135, 65, 30, "Ok")
      PureRESIZE_SetGadgetResize(#Button_Cancel, 0, 0, 1, 0)
      PureRESIZE_SetGadgetResize(#Button_Ok, 0, 0, 1, 0)
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0() 

Repeat 
  Select WaitWindowEvent() 
    Case #PB_Event_CloseWindow 
      Select EventWindow() 
        Case #Window_0 
          CloseWindow(#Window_0) 
          Break 
      EndSelect 
  EndSelect 
ForEver
Both look good to me. How should the buttons move when the window is resized ?

Posted: Wed Jan 16, 2008 8:18 pm
by tinman
gnozal wrote:How should the buttons move when the window is resized ?
Like the first example, but the size of both gadgets increase as well as being anchored to the left and right edge. Here is some code that shows the effect I would like to achieve:

Code: Select all

EnableExplicit

Define.l event
Define.l quit : quit = 0

Define.l original_width, new_width, diff_width

Structure lrf
    left.f
    right.f
EndStructure

Dim gadget_adjust.lrf(2)
Dim gadget_pos.lrf(2)

Define.lrf new

If OpenWindow(0, 0, 0, 400, 300, "foo", #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget|#PB_Window_TitleBar|#PB_Window_ScreenCentered)

    original_width = WindowWidth(0)

    If CreateGadgetList(WindowID(0))
        ButtonGadget(1, 10, 265, 100, 25, "OK")
        ButtonGadget(2, 290, 265, 100, 25, "Cancel")
        
        ; Copy existing positions
        gadget_pos(1)\left = 10 : gadget_pos(1)\right = 110
        gadget_pos(2)\left = 290 : gadget_pos(2)\right = 390
        
        ; Set resize options
        gadget_adjust(1)\left = 0.1
        gadget_adjust(1)\right = 0.5
        
        gadget_adjust(2)\left = 0.5
        gadget_adjust(2)\right = 0.9
        
    EndIf

    While Not(quit)
        event = WaitWindowEvent()
        Select event
            Case #PB_Event_CloseWindow
                quit = 1
                
            Case #PB_Event_SizeWindow
                new_width = WindowWidth(0)
                diff_width = new_width - original_width

                ; Move gadget edges
                new\left = gadget_pos(1)\left + diff_width * gadget_adjust(1)\left
                new\right = gadget_pos(1)\right + diff_width * gadget_adjust(1)\right
                ResizeGadget(1, new\left, 265, new\right - new\left, 25)

                new\left = gadget_pos(2)\left + diff_width * gadget_adjust(2)\left
                new\right = gadget_pos(2)\right + diff_width * gadget_adjust(2)\right
                ResizeGadget(2, new\left, 265, new\right - new\left, 25)
        EndSelect
    Wend
    
    CloseWindow(0)
EndIf
End
And it's not just for OK and Cancel, I have some settings (3) arranged horizontally across a window and I want them to use roughly a third of the window each. But there are other things which must remain at a fixed size in between them, although move. See ->this image<- then ->this image<-.

Edit: URL incorrect.