Display formatted text in a window using python - database

I make a program in wxpython which displays questions to the user and a radiobox with answers. Questions and answers should be in a database and is formatted text using some mathematics (paranthesis, root squares etc). Could you propose me what widget I should use for such a text and what could be the database?
Thanks.

For database you can use any sql based DB e.g. mysql or sqllite but if you do not have much data why not just store it in text files or as python module itself.
Displaying math symbols part is tricky, you will need a control which can display MathML(http://en.wikipedia.org/wiki/MathML) , I don't think any wxPython widget can do that, some browsers display MathML, so you may embed browser inside wxpython but that is also tricky.
Another alternative is to use mathplotlib to draw math symbols e.g. see http://matplotlib.sourceforge.net/users/mathtext.html#mathtext-tutorial
but IMO simplest/best way would be to just convert mathml xml to a image file and display it in a image control inside your app.
e.g. you can use http://sourceforge.net/projects/svgmath/ to convert mathml to svg, convert svg to png using http://librsvg.sourceforge.net/
or you can also try http://sourceforge.net/projects/jeuclid/
You will have to experiment to see what is easiest for you but i don't think there is any easy way.

Related

display docx file into a winform in c#

I'm trying to make my program have the ability to display a Microsoft Word file on a form but not having any luck in doing so. I want to be able to open the file and display it on the form as a Read-Only. So basically just display it's contents. Various users on the web have recommended displaying files in the WebBrowser control (under toolbox). I have tried this but failed to get it working. My end goal is to be able to annotate on top of the web browser (or something of similar manner) and subsequently save the annotations along with the opened file.
I'm not that experienced in the C# language too so any help on how to achieve my problem would be greatly appreciated.

Embedding Image Editor in ADF page

My requirement is that I shall be able to render an image in ADF page as well as can scale the rendered image, edit it, rotate in as necessary.
Does ORACLE ADF gives me out of the box support for that.
Note: I want to use something like this for image editing
http://jdevadf.oracle.com/adf-richclient-demo/faces/components/hierarchyViewer.jspx#%2Fcomponents%2FrichTextEditor.jspx
There is nothing like that in ADF.
You'll have to write your own component using a lot of Javascript to handle all that functionality.
There is nothing like that in ADF.
BUT you can use one of numerous jQuery plugins to address your needs.

Displaying PDF content within Silverlight

The requirement is below:
--> The version of Silverlight is 3.0
--> I don’t want to convert it to jpg, png etc. since I want end user to copy data from the displayed data.
--> I am currently using IFrame to display pdf but it has some problems like IFrame not supported consistently across different browsers.
--> I could not find any control (third party) that displays pdf with SL 3.0 Most of the controls that I came across are either for 4.0 or does conversion into some png kind of format which doesn’t allow user to copy data. If there is nothing that can be done from SL easily then I am ready to use 3rd party controls that are meant to work with SL 3.0 and allow end user to copy data.
--> I thought about reading data from pdf and displaying again over some control like text block but this would eventually become complicated for scenarios where I have to maintain formatting and displaying images etc.
Please suggest on this.
I think you gonna lose this one. I don't know of anything that renders PDF well in Silverlight 4 let alone Silverlight 3.
Whilst this comment "IFrame not supported consistently across different browsers" may be true IFrame is generally supported by the all major browsers.
Hence your best bet is to test and tweak your IFrame solution with these browsers.
Alternatively launch an independent browser window to display the PDF or let the users local system use whatever it has installed to display the PDF.

What controls should I use on a Silverlight website for loading textual content?

I am embarking on development of a Silverlight based website. I am the lone developer and am doing it on my own (ie, not for any company).
Now I want to load a lot of textual content on the website along with animations and rich user interfaces that can be created using Silverlight. The text content may change from time to time and when that happens, I don't want to do a lot of rework. So I m thinking to load the text from a Word/text file into controls and whenever new content arrives/existing content is modified, I just have to append it to the Word/text file.
This way the application itself remains untouched, only the file contents keep changing. Silverlight doesn't support FlowDocument. RichTextBox doesnt have a Load or LoadFile property. So how do I go about this? Should I make use of Frame, Downloader and similar other controls as well? What do you suggest? What would be the best approach to this?
The RichTextBox does have a Xaml property so you could download Xaml files containing the restricted set of textual elements that RichTextBox supports. You could also create a Silverlight editor around which you could create and upload this Xaml text content.
However have you considered whether Silverlight is the right platform to deliver primarily textual content? HTML is pretty good at that and with frameworks such as JQuery you can create quite interactive experiences that work well across browsers.

Recommended WinForms control for lots of read-only formatted text

I`m working in a serial terminal project developed in VB.NET.
I need to display a lot of formatted (color, font styles) text data in a read-only control (the incoming serial data).
I don`t know if it's a good idea to use richtext control or a grid, or there's a better third party control?
Thanks
I've used Scintilla.NET for this sort of thing before: http://scintillanet.codeplex.com/
It's designed for use in text editors, but it can be made read-only, and it's pretty quick even for large quantities of text. You get efficient per-character control over colours and basic text styling, though not to the same extent as the Rich Edit control.
Negative points are that it's based on a control designed for use from C++ code, so there's not much in the way of .NET-specific documentation. And the .NET code is in C#, so it's probably best if you have a passing familiarity with that.
I think the RichTextBox would be a good place to start since it's included and then you could upgrade to a 3rd party control if you hit any limitations (I'm assuming that cost is important).
Please note though that it can be a bit slow at colouring text depending on the method used. This article shows a supposedly (I haven't tried it) faster way of doing it:
http://codebetter.com/blogs/patricksmacchia/archive/2008/07/07/some-richtextbox-tricks.aspx

Resources