ExtJS 4.x: How to disable the red mark BUT only in runtime - extjs

I can't find solution. I want to leave "red corner" when user update grid cell (and to remove red corner now is quite easy - in afretedit call data.record.commit()) but I don't know how to do it in runtime. I meke some loops to calculate something (sum of raw e.g.) and this value I want to write in one, special cell but WITHOUT RED MARK.
Be so kind to prompt me how.

Sorry guys, I found proper soolution. Good way is to read manual, I just commited store of this grid after described above loops:
store.commitChanges()

Related

WPF dynamically scale TextBlock Text without filling a container

I have a set of pages that look like this:
I have the content in grids with * Heights and Widths so the grid correctly scales when the entire window resizes. I would like the text to resize with the grid. Basically I would like the user to resize from this:
To this:
(preserving white space)
One way to do this would be to wrap the TextBlock in a ViewBox with margins on the right and bottom (for Grid.Row="3") to account for white space. But because I have several pages with different lengths and line counts I would have to set the margin specifically for each page otherwise the text sizes would differ on each page. Is there a better way to do this??
I don't think there is a better way to do this. There are different ways. But, I think it isn't just a matter of opinion that they would not be better.
Ways I can think of.
Render your text offscreen, rendertargetbitmap that so you've got a picture. Change your textblocks on screen to images and stretch them.
Or
Work out the size your text wants to be. Then do some calculation comes up with a different fontsize which is "better". This is a lot easier to write a description of than do.
In my opinion.
A viewbox is easier to implement. Way less error prone than calculations. Will give at least as good results as rendering to a picture.
I just want to add one more solution to the ones suggested by Andy, which is more of a scientific approach and takes a bit of practice to master.
Suppose you have to find a function F, which maps one or more variables to a desired single value. In your case that would be a function F, which takes aspect ratio of the window as input and outputs an appropriate font size.
How can you find such a function?
Well... you don't need to do any math yourself!
First, you need some data to begin with:
1. Resize the window randomly
2. Calculate aspect ration (X)
3. Pick an appropriate font size that looks good enough (Y)
4. Repeat the measurement 7 to 10 times (sorry data scientists)
5. Enter the data in Excel - one column for X and another one for Y
6. Insert a scatter chart
7. Choose the best trendline for your data, but avoid the polynomial one
8. Display the trendline equation and use the expression in your code
Now I should mention the pros and cons of this regression technique.
Pros:
1. It can solve a wide range of tricky problems:
"I use this 3rd party control, but when the text is too long it overlaps the title bar. How to trim it so it doesn't go beyond the top border?. Deadline is coming!"
2. Even if it doesn't solve the problem perfectly, the results are often acceptable
3. It takes minutes to try out unlike spending a day refreshing your math skills
Cons:
1. The biggest problem is that to keep it simple, you often lower the number of
variables by assuming some of them to be constant. In this post I've assumed that
the font family won't change for example, neither the font weight.
2. If any of the assumptions does not hold the final result could be even worse
This technique is fragile, but powerful. Use it as your last weapon and never leave magic expression like
fontSize = (int)(0.76 + 1.2 * aspectRation) without documenting how it came to be.

Bounding Box using c in opencv

I am trying to create a bounding box around each character in an image. I have converted the image to binary and thresholded it but I don't understand how to create a bounding box despite reading the manual.
There are a few options for the bounding box technique, but I think you'll get a great result combining these two:
First, use the technique demonstrated here to detect a large portion of text and put a bounding rectangle around it so you crop the image to this area;
Second, experiment with the technique recently presented by OpenCV, also demonstrated here. It could be used to locate/extract individual characters on the resulting image of the first step.
I suppose you are trying to implement the OCR mechanism yourself instead of relying on great APIs such as Tesseract.
If you are looking for more information on how to do digit/text recognition, check this answer.
As said before "rudely", I encourage you to rewrite your question with more detail on what you already did. We didn't understand what you would like to do. If character recognition is what you want, have a look at this.

WPF tabswitch/ render takes too much time

I have a WPF application with many tabs..
in one tab.. i make a verycomplex vector drawing consisting of thousands of drawing visuals.. (this represents a machine and all elements need to be interactable..)
It takes 3/4 seconds for drawing this for the first time..After the first draw it should be done..
The problem is if i switch to another tab and comeback, it takes atlease 2,3 seconds to show the tabpage with drawing again.. Since there is no redraw, why should it take so much time..?
If the component is not going to change, you could call Freeze() on it to mark it as done. Without trying it out I don't know if that would help, but you could give it a shot.
Not all objects are Freezable. Check out the MSDN documentation for more info:
http://msdn.microsoft.com/en-us/library/ms750509.aspx
Another thing you could try would be rendering the vector art to a bitmap, and displaying that. Maybe it makes you feel icky to lose the vector precision, but if you know it's not going to change and it will look the same, what's the harm? (If you support printing or something that will require a hi-res version, you could always switch back for that operation.) For info on how to convert a UIElement to a bitmap, check out:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.aspx
Another possible solution: You don't really explain what kind of interaction you are doing with the elements, but if all you want to do is zoom and pan, a RenderTransform may be good enough (which is more efficient than a LayoutTransform and/or moving all the elements individually). I haven't played around with combining Freeze() and a RenderTransform, but you may be able to get the desired zooming while reducing the amount of layout WPF has to do.

Bullets and Numbering in Silverlight

I'm looking for some comprehensive library for Silverlight on bullets/numbering. I've found a few, like Vector Light's RTB control, but most are lacking extended features of bullets/numbering that word processing programs have, like having the First Line Indent of a great value than the Hanging Indent (e.g. first line indent is 1 inch and hanging indent is .5 inch). Another example is customizing the size of the bullet/number Anyone know of good libaries for this for Silverlight?
Check out the ordered/unordered list controls explained in this link. You can extend its functionality to acheive what you intend to do. I have used it to show hierarchical data using nested lists and found it fairly easy to modify it to my needs.
that implementation works for read-only content only.
What if you need to apply bullets/numbering/indent to selected-text in a RichTextBox?
You have to programmatically find Paragraph elements inside selected-text and insert the corresponding character (bullet or number of tab) at the start of each Paragraph element.
Check out here for detailed explanation: http://www.codeding.com/?article=22

Creating "flippable" content in Silverlight

I'm currently trying to build my personal website with Silverlight 3 and I've got this idea that you should be able to flip through the content in a certain way. I haven't seen exactly what I wanted before, so I uploaded a screenshot of the design for you guys to get a better idea of what I'm talking about:
Picture of desired effect http://www.bo-mortensen.dk/bmdkflip.jpg
As you can see it's more or less a carousel on the X axis. I've seen a fair number of carousel tutorials, but it seems to be quite "complicated" for what I'm looking for.
My main problem is that I fail to understand how to make this thing dynamic. I can sure do the flipping animations, but when it comes to the best approach of making the bottom page (the mirrored one) the previous etc, I'm a bit lost :)
I'm looking for any good advice on how to make this dynamic in such a way that the only thing that needs to be changed is the content itself (text, pictures etc) Also, I believe that each page/usercontrol should be using the same two (flip up and flip down) animations, if that's possible at all?
Hope I made myself clear on this - it's late after all ;) If not, just let me know and I'll see if I can elaborate!
Looks like you are looking for a Flippable 3D control. So check out my blog for one and you can tweak it to make vertical rotation.
http://jobijoy.blogspot.com/2009/04/3d-flipper-control-using-silverlight-30.html

Resources