Create a "book page" in C++.

Hello C++ Experts,
First of all, I just want to say that I LOVE C++, but I just don't know much about it yet. I am trying to study and learn it right now, as I have been off and on for years, but because of the time issues and being married now with 2 very active small boys, it is hard to find the necessary time to study. Anyway, on to my question. I was wondering, is there a way in C++ to model like a page in a book type of thing with text on it? What I want to do is, build some bible software for my father-in-law with search capabilities so he can like, highlight a certain word, click a "search" button, and it will show him a list of sorts of all the "pages" where that word is located. Then he can just go to that certain page to read the scriptures on that page.
Right now I'm working as a web developer in .Net (ASP.Net and VB.Net), and I know I could just make a bunch of HTML pages with links on them, but I would really like to do it in C++ because I want to learn it. The company I work for used to use some software called Omniform and it was kind of similar as it looked like "pages" even with a drop shadow on the bottom of the page, but I don't know how they (Omniform) created that. I think they are owned by Nuance now. But it looked really cool to have all our text and textboxes on a "page" with links at the bottom for page 1, page 2, and so on. It was pretty neat software.
Now I know there are programs like QT, and there is OpenGL, and wxWidgets and stuff like that, but do, or did some of these companies like Omniform code their stuff in just C or C++ back in the day? You know, like before there were things like QT and stuff to make things easier? Is there a way to just hand code something like this so I could really get a feel for the language? If any one of you awesome C++ programmers that has been doing this sort of thing for a while could comment, or lead me in the right direction, I would really appreciate it. I would REALLY love to know how to do something like this.
Also, I'm using Bloodshed's Dev-C++ IDE, as I really like it.
Assuming you want this in 2d, your best bet would be to familiarize yourself with a graphics library such as SDL or SFML. With C or C++ alone it is not possible to do what you're asking. You will also need to create the page graphics.
Ok, thanks Return 0, so a couple more questions if you don't mind. First of all, let's see if I got this right. SDL is Simple DirectMedia Layer and it's found here:
http://www.libsdl.org/
And SFML is Simple and Fast Multimedia Library and it's found here:
http://www.sfml-dev.org/
Right?
And if both of those are right, then is that how maybe Omniform or some other bible or book creating software companies created their "page" look?
One more question, so the "page" look is just a graphic then with text on top of it?
Thanks for replying.
Both links are correct. I don't know much about Omniform, but a quick google search indicates it converts paper to digital. I don't know what technology went into Omniform, but yes they would be using some sort of graphics API to get the graphics on the screen... again I have no idea what that software does or looks like. The way it would work in say SDL for example is lets say you wanted each page to look like some old parchment and you had an image of one and you managed to get the entire contents of the Bible in a text file.

In SDL you will load an image to a Surface, read in text from say a text file using a TTF_Font and then place them on a Surface and blit them to the screen so that the text is overlaying the page. It is of course a little more difficult than that, but you should get the idea.
Wow thanks Return 0,
you sure pointed me in the right direction. Hey I found another company that I think does something similar. Form Tool.
http://www.formtool.com/
Well, I'm thinking that if I am able to do it, I only want to just do a New Testament version for him. I mean, that's a LOT of typing and I was thinking about getting my wife to help me out with some of that; of course, I haven't ran this by her yet. But I'm sure she'll comply. :D

Btw, I really like your username "Return 0" that's neat.

Thanks for everything.

milli
I don't think you want to type the entire new testament :). Take a look online and see if you can find the books in a text file or something. Here is an example:

http://patriot.net/~bmcgin/kjv12.txt
http://patriot.net/~bmcgin/kjvpage.html

The down side of course is you have no idea if someone altered the text. Good Luck!
Alteration, especially of something like the Bible, is a valid concern. But I think you can spot alterations pretty easy if you cross reference everything with other sources. Just make sure you stick with one version for example if you start on the King James version then stick to that or else your cross references will get bogged down with minor symantic conflicts.

I have no doubt that the bible is in public domain by now so you should be able to just copy and paste it from where ever. But watch out for that "Sweat Of The Brow" crap in case someone wants to try to claim it as their own I'm not a lawyer and I don't know how it might apply here. http://en.wikipedia.org/wiki/Sweat_of_the_brow

EDIT: Also I wanted to ask if this has anything to do with that Bible code theory?
Last edited on
Wow thanks Return 0, Computergeek01, you both gave me something to think about. I guess I didn't think all of this through completely. That would be a lot of typing, and, on the other hand, with copying and pasting, I would have to be careful; I guess even if it is just freeware for my father-in-law. I know you still have to be careful.
Oh, Computergeek01, I just saw your last edit, sorry, but anyway, no it's not about that. I really don't know much about that Bible code theory. It was just going to be something for my father-in-law to read on the screen instead of in the bible. Just a little gift from me to him. And to see if I could do something like that, you know, to learn more C++ coding. That's all.

I always kind of wondered how to make a "book" type of application anyway, especially since we started using Omniform several years ago when I started working here at my previous job. Actually, they were already using it when I got here and I was like, "well that's neat, how did they create that 'page' look?"
Last edited on
Don't get discouraged. It's a good project to work on. Start by locating the text online that you feel comfortable with and then you can start designing your app. I wouldn't be too concerned with copyright, you aren't planning on distributing the program to the public correct?
Yes, that's correct Return 0, it is just going to be freeware for my father-in-law. I thought that would be a good little project to work on in my spare time.
One more thing guys, I got to thinking about it, so I opened up Writer in OpenOffice and you know, it kind of like looks like a page a little, and I guess Word would look like that too. We used to use Word but we're moving to OpenOffice now so I no longer have the Office suite on my computer. But anyway, I know that's a word processor but I know y'all get the idea of what I'm talking about. It resembles a sheet of paper with a drop shadow on the right side and bottom of the "page".
Yeah you'll need to create the graphic. Just rip it from somewhere. You aren't distributing so it doesn't matter. You could even take a print screen of the blank page and use it in your application, because you're not going to want to try to draw one using an API.
>>rip it from somewhere...You could even take a print screen of the blank page and use it in your application...
Man, now that's a thought. Yeah, and I'll never charge for it, even if I end up making this for my father-in-law. It's just for him as a little gift, and for me to get in some C++ experience.
In SDL you will load an image to a Surface, read in text from say a text file using a TTF_Font and then place them on a Surface and blit them to the screen so that the text is overlaying the page. It is of course a little more difficult than that, but you should get the idea.


Not to interrupt this topic but graphics drawing are pretty similar to the above. It is just different SDK API provide different class, method names etc etc to achieve the above.

Usually a classic method name I always came across is called onDraw(...) :P
Ok thanks sohguanh, I really appreciate everyone's input.

~milli
Topic archived. No new replies allowed.