Skip to content

Added fixes provided on the issue section #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Unbreakable-Syntax
Copy link

@Unbreakable-Syntax Unbreakable-Syntax commented Nov 23, 2024

This PR modifies the RJTextBox.cs file to include all the fixes indicated in the Issues section of the project.

The fixes are:

  1. Placeholder text validation
  2. BackColor transparent fix
  3. Texts property setter method incorrectly receiving data as placeholder text

This fix aims to provide a simple condition to check if the rounded textbox either contains the placeholder value or it is actually empty, if it is, the IsEmpty() method will return true.
To use it, it is as simple as rjTextBox2.IsEmpty(), this can be used as an evaluation method for database systems to avoid having the false null value issue (where the textbox does not have any input, but the database reads and adds the placeholder text inside the rounded textbox anyway).
This change fixes a bug where, if the control receives a new text in the Texts property, it displays the text, but it is still considered a placeholder which is wrong.

This is fixed by first checking if the string is not empty, if yes, remove and disable the placeholder text, and then set the Text property of the textbox to the actual value.
This change makes the custom control to cache the render points necessary for drawing the control itself. When OnPaint() is called and no property that is a factor for rendering has changed (borderRadius for example), OnPaint() will not redraw the control entirely, instead, it will simply reuse the previously calculated data points and recolor the control. This change should (in theory) improve rendering performance for this control.
This also corrects the wrong textbox name issue.
This is an extended application to the cache optimization that I made, this change makes it so that now, OnPaint() will not provide set a new Region to the control everytime, it only does so when the layout has changed.
This change allows the control to have less flickering, I have observed the effects of this change myself and I say it works.
This fix ensures that when the control is stretched out, it will redraw itself properly.
This change allows the textbox to sanitize the input by removing the newline characters. Which can be very annoying to spot and notice since it can break things, such as string evaluators and database entries. This property is used alongside the Multiline property.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant