Latest version of libraries... =/

Just starting out? Need help? Post your questions and find answers here.
User avatar
flaviofornazier
User
User
Posts: 11
Joined: Mon Jan 06, 2014 8:28 pm
Location: Brazil

Latest version of libraries... =/

Post by flaviofornazier »

Hi guys,


Someone could give me a right direction
to download the latest version of PureFORM
(2008, I think...), PureRESIZE, PureCOLOR
and other free libraries from Mr.Philippe 'Gnozal' Guntz?

I've been searching for a long time and seems
that all links are broken.

I apologize for the topic if that is the case. =/

Thank you in advanced.


PS: Sorry for my english, my first language is
portuguese and second, spanish.
PB 6.10 LTS x86/64 - WXP - W7/x86-64 - W8/x64 - W10 x86/x64 - W11 - Ubuntu Mate 23 x86/x64 - OSX Yosemite 10.9
User avatar
flaviofornazier
User
User
Posts: 11
Joined: Mon Jan 06, 2014 8:28 pm
Location: Brazil

Re: Latest version of libraries... =/

Post by flaviofornazier »

Thank you for your fast reply Mr.Moderator

I'll download all the free resources from this site and share them
trough my ftp with Purebasic comunity.

Unfortunately, PureRESIZE and PureCOLOR don't
compiles in PB 5.50, I receive the following error:

POLINK: error: Unresolved external symbol: '_SYS_CopyString'

After an exaustive search I think that anyone solved this issue.

Thank you very, very much.

Best Regards.
PB 6.10 LTS x86/64 - WXP - W7/x86-64 - W8/x64 - W10 x86/x64 - W11 - Ubuntu Mate 23 x86/x64 - OSX Yosemite 10.9
loulou2522
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Oct 14, 2014 12:09 pm

Re: Latest version of libraries... =/

Post by loulou2522 »

Is There a version of Pureresize for PB 5.60 ?
Thanks in advance ?
User avatar
Bisonte
Addict
Addict
Posts: 1305
Joined: Tue Oct 09, 2007 2:15 am

Re: Latest version of libraries... =/

Post by Bisonte »

loulou2522 wrote:Is There a version of Pureresize for PB 5.60 ?
Thanks in advance ?
PureResize is windows x86 only and gnozal is not avaible...

But srod published in 2008 the "nxResize",
that works with all windows => XP

I fit it in a module long time ago... so here it is :

Code: Select all

;*============================================================================
;*   **nxResize***
;*
;*   ©nxSoftWare 2008  (www.nxSoftware.com)
;*============================================================================
;*   Stephen Rodriguez (srod)
;*   Created with Purebasic 4.3 for Windows.
;*
;*   Platforms:  NT/2000/XP/VISTA.
;*               No promises with 'early' versions of Windows!
;*============================================================================
;*   Fit to Module by Bisonte (PB5.20Beta8)
;*============================================================================

DeclareModule nxResize
  
  ;*==========================================================================
  ;*   **nxResize***
  ;*
  ;*   ©nxSoftWare 2008  (www.nxSoftware.com)
  ;*==========================================================================
  ;*   Stephen Rodriguez (srod)
  ;*   Created with Purebasic 4.3 for Windows.
  ;*
  ;*   Platforms:  NT/2000/XP/VISTA.
  ;*               No promises with 'early' versions of Windows!
  ;*==========================================================================
  ;*   Fit to Module by Bisonte
  ;*==========================================================================

  
  #AnchorLeft    = 1
  #AnchorTop     = 2
  #AnchorRight   = 4
  #AnchorBottom  = 8
  #AnchorAll     = #AnchorLeft + #AnchorTop + #AnchorRight + #AnchorBottom
  
  Declare.i GetResize(gadget)
  Declare.i SetResize(gadget, flags)

EndDeclareModule
Module        nxResize
  
  ;*==========================================================================
  ;*   **nxResize***
  ;*
  ;*   ©nxSoftWare 2008  (www.nxSoftware.com)
  ;*==========================================================================
  ;*   Stephen Rodriguez (srod)
  ;*   Created with Purebasic 4.3 for Windows.
  ;*
  ;*   Platforms:  NT/2000/XP/VISTA.
  ;*               No promises with 'early' versions of Windows!
  ;*==========================================================================
  ;*   Fit to Module by Bisonte
  ;*==========================================================================
  
  #nxResize_PROPOldProc = "nxResize_OldProc"
  #nxResize_PROP = "nxResize_ptr"
  
  Declare.i nxResize_ParentProc(hwnd, uMsg, wParam, lParam)
  Declare.i nxResize_Proc(hwnd, uMsg, wParam, lParam)
  
  ;The following structure is used by each gadget being resized dynamically. 
  ;On top of this a gadget being dynamically sized can also be a container 
  ;for other gadgets being dynamically sized.
  ;We thus need to subclass carefully.
  Structure _nxResize
    flags.i               ;Combinations of #nxResize_AnchorLeft etc.
    leftmargin.i
    topmargin.i
    rightmargin.i
    bottommargin.i
    oldProc.i
  EndStructure
  
  ;-LIBRARY FUNCTIONS.
  
  ;The following function returns a gadget's dynamic resizing attributes.
  ;It returns a combination of #nxResize_AnchorLeft, #nxResize_AnchorTop, 
  ;#nxResize_AnchorRight #nxResize_AnchorBottom and #nxResize_AnchorAll.
  ;Returns zero if no attributes are set.
  
  Procedure.i GetResize(gadget) ; returns a gadget's dynamic resizing attributes.
    Protected result, *ptr._nxResize
    If IsGadget(gadget)
      *ptr = GetProp_(GadgetID(gadget), #nxResize_PROP)
      If *ptr
        ProcedureReturn *ptr\flags
      EndIf
    EndIf
    ProcedureReturn 0
  EndProcedure

  ;The following function sets a gadget for auto resizing.
  ;If flags = 0 then the resizing is cancelled.
  ;Returns zero if an error.
  
  Procedure.i SetResize(gadget, flags) ; sets a gadget for auto resizing.
    Protected result, hwnd, parenthWnd, *ptr._nxResize
    Protected rc.RECT
    If IsGadget(gadget)
      hwnd = GadgetID(gadget)
      ;If flags = 0 then the dynamic resizing is to be cancelled.
      ;However, we can only remove the #nxResize_PROP if this gadget is not a container
      ;to others being dynamically sized because of the possible 'chained' subclassing.
      If flags = 0
        *ptr = GetProp_(hwnd, #nxResize_PROP)
        If GetProp_(hwnd, #nxResize_PROPOldProc) = 0 ;Not a container to other gadgets being resized.
          RemoveProp_(hwnd, #nxResize_PROP)
          If *ptr
            SetWindowLongPtr_(hwnd, #GWL_WNDPROC, *ptr\oldProc)
            FreeMemory(*ptr)
          EndIf
        ElseIf *ptr
          *ptr\flags = 0
        EndIf
        result = 1
      Else ;Some form of dynamic resizing is to be enabled.
        ;Has dynamic resizing already been enabled for this gadget?
        *ptr = GetProp_(hwnd, #nxResize_PROP)
        If *ptr = 0 ;No!
          *ptr = AllocateMemory(SizeOf(_nxResize))
          If *ptr
            ;Create a property in which to store a pointer to this structure.
            If SetProp_(hwnd, #nxResize_PROP, *ptr) = 0
              FreeMemory(*ptr)
              ProcedureReturn 0
            EndIf
            ;Subclass the gadget.
            *ptr\oldProc = SetWindowLongPtr_(hwnd, #GWL_WNDPROC, @nxResize_Proc())
          Else
            ProcedureReturn 0
          EndIf
        EndIf
        ;Set the remaining fields of the structure.
        parenthWnd = GetParent_(hwnd)
        GetClientRect_(parenthWnd, rc)
        With *ptr
          \flags = flags
          \leftmargin = GadgetX(gadget)
          \topmargin = GadgetY(gadget)
          \rightmargin = rc\right - \leftmargin - GadgetWidth(gadget)
          \bottommargin = rc\bottom - \topmargin - GadgetHeight(gadget)
        EndWith
        ;Subclass the parent window if not already done through another call to this function.
        If GetProp_(parenthWnd, #nxResize_PROPOldProc) = 0
          SetProp_(parenthWnd, #nxResize_PROPOldProc, SetWindowLongPtr_(parenthWnd, #GWL_WNDPROC, @nxResize_ParentProc()))
        EndIf
        result = 1
      EndIf
    EndIf
    ProcedureReturn result
  EndProcedure

  ;-INTERNAL FUNCTIONS.
  
  ;The following function is the EnumChildProc callback.
  Procedure.i nxResize_EnumChilds(hwnd, parenthWnd)
    Protected *ptr._nxResize, ctrlID, l, t, r, b
    Protected parentrc.RECT
    ;Check that the control is an 'immediate child' of the parent.
    If GetParent_(hwnd) = parenthWnd
      ;Check if the child window is set for dynamic resizing.
      *ptr = GetProp_(hwnd, #nxResize_PROP)
      If *ptr And *ptr\flags
        ctrlID = GetDlgCtrlID_(hwnd)
        l = GadgetX(ctrlID) : t = GadgetY(ctrlID) : r = l + GadgetWidth(ctrlID) : b = t + GadgetHeight(ctrlID)
        GetClientRect_(parenthWnd, parentrc)
        If *ptr\flags & #AnchorRight
          r = parentrc\right - *ptr\rightmargin
        EndIf
        If *ptr\flags & #AnchorLeft = 0
          l = r - GadgetWidth(ctrlID)
        EndIf
        If *ptr\flags & #AnchorBottom
          b = parentrc\bottom - *ptr\bottommargin
        EndIf
        If *ptr\flags & #AnchorTop = 0
          t = b - GadgetHeight(ctrlID)
        EndIf
        ResizeGadget(ctrlID, l, t, r-l, b-t)
      EndIf
    EndIf
    ProcedureReturn 1
  EndProcedure
  
  ;The following function is the subclass procedure for the parents of 
  ;all gadgets being dynamically resized.
  Procedure.i nxResize_ParentProc(hwnd, uMsg, wParam, lParam)
    Protected result, oldProc
    oldproc = GetProp_(hwnd, #nxResize_PROPOldProc)
    Select uMsg
      Case #WM_NCDESTROY
        RemoveProp_(hwnd, #nxResize_PROPOldProc)
      Case #WM_SIZE
        ;Here we loop through all immediate child windows and resize where appropriate.
        EnumChildWindows_(hwnd, @nxResize_EnumChilds(), hwnd)
    EndSelect
    If oldproc
      result = CallWindowProc_(oldproc, hwnd, uMsg, wParam, lParam)
    EndIf
    ProcedureReturn result
  EndProcedure

  ;The following function is the subclass procedure for all gadgets being
  ;dynamically resized.
  Procedure.i nxResize_Proc(hwnd, uMsg, wParam, lParam)
    Protected result, *ptr._nxResize, parenthWnd, rc.RECT, gadget, OldProc
    *ptr = GetProp_(hwnd, #nxResize_PROP)
    If *ptr
      oldProc = *ptr\oldproc
      Select uMsg
        Case #WM_NCDESTROY
          RemoveProp_(hwnd, #nxResize_PROP)
          FreeMemory(*ptr)
        Case #WM_MOVE, #WM_SIZE
          gadget = GetDlgCtrlID_(hwnd)
          ;This takes care of the user repositioning\resizing the gadget through ResizeGadget() etc.
          ;In such cases we do not prevent the move but reset the dynamic resizing properties.
          If *ptr\flags And GadgetWidth(gadget) And GadgetHeight(gadget)
            parenthWnd = GetParent_(hwnd)
            GetClientRect_(parenthWnd, rc)
            With *ptr
              \leftmargin = GadgetX(gadget)
              \topmargin = GadgetY(gadget)
              \rightmargin = rc\right - \leftmargin - GadgetWidth(gadget)
              \bottommargin = rc\bottom - \topmargin - GadgetHeight(gadget)
            EndWith
          EndIf
      EndSelect
      result = CallWindowProc_(oldproc, hwnd, uMsg, wParam, lParam)
    Else
      result = DefWindowProc_(hwnd, uMsg, wParam, lParam)
    EndIf  
    ProcedureReturn result
  EndProcedure

EndModule
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
Post Reply