B4J Question richviewfx codearea resize question

Discussion in 'B4J Questions' started by Mahimahi, Feb 8, 2019.

  1. Mahimahi

    Mahimahi Member Licensed User

    Referencing a custom view graciously created and shared by "stevel05", from https://www.b4x.com/android/forum/threads/custom-view-richviewfx-codearea.62823/

    Hi, I am trying to switch from using TextArea to CodeArea to take advantage of highlighting of text. With TextArea I was able to resize when the main layout window resizes using .PrefWidth = MainLayoutForm.Width - x, and .PrefHeight = MainLayoutForm.Height - y. With CodeArea I tried doing .setup(MainLayoutForm, Null, 0, 400, MainLayoutForm.Width - x, MainLayoutForm.Height-y) which resizes the control initially when app starts, but while the window/main layout resizes, it doesn't seem to be resizing in MainLayoutForm_Resize event sub.

    Can someone please give some pointers? Thanks a lot.
     
  2. stevel05

    stevel05 Expert Licensed User

    As it is a custom view, you need to change the base pane size richtextview1.BasePane.SetSize(Widht Height), Setup should only be called once.
     
  3. Mahimahi

    Mahimahi Member Licensed User

    Thanks for the insight stevel05, it works well. On a different note, I came across a small issue generating the _TextChanged event sub from designer and it has parameter (text as string) and when the program ran, it gave me a

    "java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception: Sub codearea1_textchanged signature does not match expected signature."

    In the end, I looked at your sample program and realized it should be:

    "Sub CodeArea1_TextChanged(OldVal As String,NewVal As String)"

    Just thought I mention as an fyi. Thanks a lot for your help.
     

    Attached Files:

    stevel05 likes this.
  4. stevel05

    stevel05 Expert Licensed User

    Thanks, I'll change it next time I do some work on it.
     
  5. Mahimahi

    Mahimahi Member Licensed User

    Is it possible to display scrollbars on the codearea/richtextview? Vertical scrollbar is more what I am looking to implement in the current project. Please advise. Thanks a lot.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Moved to the questions forum.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice