We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Poll: Chose Option
You do not have permission to vote in this poll.
First Option
0%
0 0%
Second Option
100.00%
2 100.00%
Total 2 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skull Custom Language Creator By ZS
#51
Litdev
I converted code into graphics windows
No ui is good I think we should have ldrichtextboxword in svb text box.
Reply
#52
Hi ZS,

I don't really use sVB, but it looks like it uses TextBox in its UI designer.  It cannot have RichTextBox functionality, they are different things and it is not one of the controls available in sVB UI designer.  

To use a RichTextBox, as far as I can see you can use LD extension, maybe others, but not directly from sVB UI designer, unless you get it implement by sVB developer.  

This is one of the reasons I try to keep everything compatible with standard SB and use extensions that can interact with standard SB to add features rather than modify the default compiler or SmallBasicLibrary.  sVB changes the compiler and basic functions with each version which makes interacting with non standard functionality (e.g. UI designer) in it through extensions impractical.  Starndard SB doesn't change, which means writing extensions for it is worth the effort.

What is the difficulty using GraphicsWindow? - I cannot see anything you are doing that cannot be done with GraphicsWindow.
Reply
#53
Litdev
How can we get caret x,y position in richtextbox.
Reply
#54
Arhh,

I was wondering when you were going to ask that! Big Grin

If you get the latest LitDev Beta (not sVB) then there is a new method LDControls.RichTextBoxMousePosition which returns the line text the cursor is at and the character number from the left.  The reason for this way of doing it is handling scrollbar scrolling and line wrapping of longer lines.

This is my test example - it is getting a bit complex, so ignore it if you want.  It also has image button - put your own image in, TWLL943.000.
Reply
#55
It helped but caret mean the line which write text in textbox
Reply
#56
Yes, what do you want from caret position, do you mean the line text and column as I did for mouse over. Row number changes with word wrapping in rtb.
Reply
#57
I want position of the last word was written so to add a list box there
Reply
#58
So that is graphicswindow coordinates or maybe coordinates in RTB not position in the text, different things especially with scrolling.

You are probably not going to be able to do everything SB IDEs do written in SB, some compromises will be needed, especially interface frills.  Why not just put the listbox at the bottom for example.  I don"t want to over clutter LD extension with very specific stuff, but I will think about this.  Get core functionality working first.
Reply
#59
ZS,

I think these are generally useful.  RichTextBoxCaretCoordinates and RichTextBoxCaretPosition added and uploaded to Beta LitDev extension, QJDK716.000.
Reply
#60
Code:
public Point getXYPoints()
{
    // Get current caret position point from CCRichTextBox
    Point pt = this.GetPositionFromCharIndex(this.SelectionStart);

    // Increase the Y-coordinate size by 10 & Font size of CCRichTextBox
    pt.Y = pt.Y + (int)this.Font.Size + 10;

    // Check if the Y-coordinate value is greater than CCRichTextBox Height - CodeCompleteBox
    // for adding CodeCompleteBox at the Bottom of CCRichTextBox
    if (pt.Y > this.Height - CodeCompleteBox.Height)
    {
        pt.Y = pt.Y - CodeCompleteBox.Height - (int)this.Font.Size - 10;
    }

    return pt;
}
HOW IT WORK???
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)