TextField/TextArea Borders

  1. 8 weeks ago

    My first post here, so greetings to everybody and the best health wishes in these complicated times.

    I just realised that TextField and TextArea borders can be only enabled/disabled in the IDE, not on the fly. Tested with 2019r3, Mac and Windows using old .border and new .HasBorder syntax.

    Is this a bug or it's due to some OS limitation ?

    Regards.

  2. 7 weeks ago

    Tested also with 2019R1, 2018R4 and 2017R2 on Mac, same situation.

    Nevertheless border can be shown/hidden on demand using NSTextFieldMBS bordered property, so seems not a OS limitation, at least on Mac.

    Would be great if this could be sorted at some point.

    Regards.

  3. Alberto D

    Apr 7 Testers, Xojo Pro Austin, Texas

    Can you create a feedback report (bug or feature request)?

  4. Michel B

    Apr 7 Testers, Xojo Pro

    The LR does not say it is limited to be set in the IDE. It looks terribly much like a bug. unless it is an LR bug.

    Do file a feedback report, with a small project demonstrating the issue.

  5. Edited 7 weeks ago

    Thanks both for the reply.

    Seems that this has been reported and verified ... in 2011.

    Feedback Case #19246

    Norman suggested there a workaround for MacOs, it works

    #if TargetMacOS
        declare sub setBezeled lib "Cocoa" selector "setBezeled:" (handle as integer, value as boolean)
        // Usage : setBezeled(TextField1.Handle, value)
      #endif
      
      if TextField1.Border then
        TextField1.Border = False
        #if TargetMacOS
          setBezeled(TextField1.Handle, false)
        #endif
      else
        TextField1.Border = True
        #if TargetMacOS
          setBezeled(TextField1.Handle, true)
        #endif
      end if

    Regards.

  6. Michel B

    Apr 10 Testers, Xojo Pro

    I tried the declare on Textarea, it does nothing.

  7. Norman P

    Apr 10 Testers, Xojo Pro outside LMAO !!!!!!!
    Edited 7 weeks ago

    one is probably and NSTextField and the other an NSTextView and they respond differently to different selectors

    that one may have no applicability to the NSTextView

  8. Yes, only for a TextField.

    Shame this can't be adjusted in Windows...

  9. Michel B

    Apr 12 Testers, Xojo Pro
    Edited 7 weeks ago

    It should be possible to do declares in Windows.

    Since every control in Windows is considered a window by the framework, this should work on a Textarea/textfield:

    https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowlonga

    Perhaps some iteration of this, I use to remove the border of a window:

    Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hwnd As Integer, nIndex As Integer, dwNewLong As Integer) As Integer
    Const GWL_STYLE = -16
     dim rien as integer = SetWindowLong(self.handle, GWL_STYLE, &H800000)


    Julian Samphire may already have that in his bag of tricks :)

or Sign Up to reply!