Table of Contents
BE ENGINEERING INSIGHTS: Three More Tips In my last article, http://www.be.com/aboutbe/benewsletter/Issue104.html, I presented you with three unrelated tips. I have three more tips, this time, all pertaining to BTextView. 1. A number of people have asked how to get TextView to reflow its text dynamically when resized (take a look at BeMail or Expander for an example). Although there is no way to tell BTextView to do this for you automatically, it's easy to implement this feature in your own TextView- derived class. The basic idea is to resize the TextView's "text rect"
whenever the window's frame is resized. The text rect is
TextView's own coordinate system in which it draws its text.
TextView wraps its text according to the width of the text
rect. (The text rect's height is dynamic -- it is always in
sync with the total height of the text.) So, to reflow the
text whenever the view is resized, implement your own
void MyTextView::FrameResized( float width, float height) { BTextView::FrameResized(width, height); if (DoesWordWrap()) { // this gets the new bounds of the view BRect textRect = Bounds(); // make sure we are in the view's coordinate system textRect.OffsetTo(B_ORIGIN); // inset the text rect by 3 pixels so that the text doesn't // touch the frame of the view: this is the text rect textRect.InsetBy(3.0, 3.0); // tell TextView to reflow itself SetTextRect(textRect); } } In order for this to work properly, make sure your TextView class has the B_FRAME_EVENTS view flag set; otherwise, it will not be continuously notified of frame resize events.
2. An easy way to spruce up your editor is to support some sort of syntax styling feature. For example, BeMail displays URLs embedded in e-mail messages in blue, and everything else is in black. It's simple to implement this feature using TextView's text_run_array structure. TextView delimits its style runs using a structure called text_run. A text_run associates a specific offset within the TextView's text buffer with a BFont and a rgb_color. So, a text_run like this text_run theRun; theRun.offset = 10; theRun.font = be_fixed_font; theRun.color.red = 255; theRun.color.green = 0; theRun.color.blue = 0; theRun.color.alpha = 255; would tell TextView that, starting at offset 10, it should start displaying its text in red be_fixed_font. A text_run_array is simply a variable-length array of text_runs. So, to continue with our URL example, every URL will have two text_runs delimiting it, one at the start of the URL to start a blue run, and one at the end of the URL to restore the text to black. Assuming that the e-mail message has been parsed and you have the offsets of the URLs, you could use something like this: // allocate some room for the text_run_array int32 number_of_runs = number_of_urls * 2; text_run_array *theTRA = (text_run_array *)malloc(sizeof(text_run_array) + (sizeof(int32) * (number_of_runs - 1))); // fill in the individual text_runs theTRA->count = number_of_runs; for (int32 i = 0; i < theTRA->count; i += 2) { // start the URL run theTRA->runs[i].offset = url_start_offsets[i]; theTRA->runs[i].font = kURLFont; theTRA->runs[i].color = kURLColor; // end the URL run theTRA->runs[i + 1].offset = url_end_offsets[i]; theTRA->runs[i + 1].font = kNormalFont; theTRA->runs[i + 1].color = kNormalColor; } When you're done constructing your text_run_array, simply
pass it on to TextView as part of a call to Now that you've successfully parsed for and displayed a URL in blue, wouldn't it be nice if clicking on it did something? Click-detection of a specific range of text in TextView is
pretty simple. You already know the offsets of the URLs, so
in your void MyTextView::MouseDown( BPoint where) { // this tells you the text offset of the click int32 clickOffset = OffsetAt(where); // assume that FindURL() returns the URL of the click // or NULL if there wasn't a URL there const char *theURL = FindURL(clickOffset); if (theURL != NULL) // while we're at it, send the user's preferred // HTML handler a message to open the URL be_roster->Launch("text/html", 1, &theURL); else // don't forget to call the original implementation! BTextView::MouseDown(where); }
3. My final tip is about TextView's text buffer's
performance. In order to reduce the number of calls to
TextView's
By: Scott Paterson One of Scott Adams' best Dilbert strips pokes fun at the standard components of trade show booths: magic tricks, special effects, raffles, and booth babes. "For the best result, combine all four: Create the illusion that you're raffling off the booth babes." I'd add race cars to the list. It stuns me to see a company pay $50K for prime trade show real estate, plop down a Porsche Boxster that takes up half the space, and then cram the actual product into the remainder. Be has done a number of trade shows over the past few years, mostly MacWorld and Fall Comdex, and recently in joint participation with Adamation at NAB. We take pains to avoid an affliction known as "Trade Show Fever" -- the assumption that trade shows are a natural part of doing business. The costs associated with these extravaganzas are incredible, not only in dollars but also in people resources. We've got a lot of work to do and when we're at a trade show, for the most part, we're not getting other work done. So you can expect to see us at PC Expo in June and Comdex in November. We'll consider a couple of other shows, but before we sign up we'll need to see extremely compelling reasons and clear paths to the goals we desire to achieve by participating. From our experience, here are a few tips to help you plan for your own future trade show participation.
The main demo is the most important part of your trade show presentation, apart from the spinning sign on top of the booth. This demo attracts people into your booth to learn more about your product. This demo should make the most of everything that's eye-catching about your product. You've got to literally stop people in their tracks and make them pay attention to you. Here's a tip for doing it: Any static image on a TV screen is boring; any moving image, no matter how boring it is, is not boring, and immediately attracts the eye. This is generally how I begin to attract a crowd. I leave the system up with a few movies playing, along with some other visual candy. I also think it's important to let people know when the next demo will start so they can decide to stay (FontDemo cycling through fonts is a good "Next Demo at" tool). Once you have a couple of people waiting, start your demo. People attract people, so you'll build a crowd during the performance. Yes, this is a performance, so it needs to be scripted in advance and taught to your main demo staff -- with enough time to practice. As for length, unless your demo is capable of winning awards, you won't keep a crowd standing around for more than 10 minutes. Show the highlights and invite them into the booth for more in-depth one-on-one demos. The one-on-one demo is more loosely organized and should be tailored to each individual depending upon their area of interest. We don't show a video developer support for printing to AppleTalk devices. One-on-one demo staff must be comfortable showing off most aspects of the product and able to customize their demo on the fly. If someone with no specific area of interest is looking for a one-on-one demo, use an extended version of the "I don't have time for a demo" demo. The "I don't have time for a demo" demo is for people who want to see a demo but only have 30 seconds. Be prepared to show them the three most impressive aspects of your product. It matters less that they are the most important or useful features, than that they can make someone say, "Wow, show me more." Finally, everyone in the booth should be able to give a demo. It never fails that, with everyone busy giving demos, someone will walk up to you, point to the one empty station, and ask for a demo. Look good, be prepared, have fun. There are few things more immediately gratifying than giving good demo. Oh, if you're in Vegas for Comdex, only play the single decks and always SPLIT aces and 8's, never 10's, 5's, and 4's.
GUEST COLUMNIST: Seed Financing for Your BeOS Project By Keith Bates Eastern Technology Seed Investment Fund So you think you have an amazing idea for the BeOS? It's potent. Compelling. Promises jaw-dropping capabilities. You can't sleep anymore because you're dreaming about it and you're coding every red-eyed moment you're awake and you're drinking way too much coffee and every chance you get you call your best friend to dream and scheme. There's only one small problem: Where do you find the capital? You could start with a venture capital seed fund. In venture parlance, a "seed" fund is a capital pool aimed at small, very early stage and high risk investments. Seed-stage companies are still in the process of technology and product development; they have little or no revenue; they are not yet engaged in marketing. This article will give you some suggestions on what to think about and cover in your seed-stage business plan. There are also a number of useful resources available on the Web and in better booksellers that will be helpful to you in creating a plan for your prospective investors. The Eastern Technology Seed Investment Fund (ETSIF) is a C$25 million (Canadian) venture capital fund created to provide financing and management support for early stage technology projects in Eastern Canada (Ontario and the Atlantic Provinces). ETSIF is distinguished by its very early stage focus and its ability to bring both equity funding and management support to technology opportunities. Most of ETSIF's initial investments are made in opportunities which do not have revenue and which are likely to require a number of rounds of venture financing before becoming cash self-sufficient. ETSIF's initial commitment is generally in the range of C$100,000 to C$500,000 but investments outside this range will be considered. We usually expect that our seed investment will be enough to get a company started towards its first "milestone" achievement. Seed stage generally is preparatory to a full-blown startup round of financing (which may be in the several millions of dollars). During seed stage several important objectives are tackled. First, the technology or application is brought to prototype or beta stage. Second, the company's management team is rounded out. Third, a comprehensive business plan is researched and written, suitable for the raising of second round financing. At the end of seed stage -- typically an eight or ten month period, perhaps shorter -- companies will be able to move towards the second round of financing.
Key Criteria: Technology, People, Customers At ETSIF we look for three essentials in any seed funding application: technology, people, and customers. The inability of an applicant to satisfy us on all of these points usually means we will not proceed further. What follows is intended to give you a sense of how we typically approach each of these three qualities, and what sorts of questions you should ask yourself in devising your plan. First, the technology must be powerful, compelling, unique. It should generally either (a) give the user a power to do things that were previously not possible, or (b) allow the user to save significant time and money over their existing solution. Small increments will not do here. It is no use saying that your solution is 20% better than the software that is available today: Your real competition is the software that is under development today. What will your advantage be when you actually begin to sell your product? How long will it last? How deep and wide will the moat be around your technology? The second factor is the quality of the people. At seed stage the fundamental focus is on the development team. We like to see a team comprised of people who have the training and experience necessary to extend and deepen the technology over time; who possess passion and vigor and commitment and integrity; who can lay the right architectural foundation; who can plan in detail and with wisdom; who can build with discipline; who know the value and place of development tools and best practices. Be sure to detail the backgrounds and individual responsibilities of your team's members. Identify any gaps in the group, and explain how you intend to fill them. The last major criterion is a simple one, but too often overlooked: customers. Who in the real flesh-and-blood world will pay hard money for your product? How many of them are out there today? Next year? Don't spend too much time dwelling on "markets," at least to begin with. Who are your customers going to be? Who will beg to test your beta? Who will buy your product? Better yet, who will pester their boss to buy your product for them? Whose heart will pound the most? That's your customer. Working backwards from that will help you see your markets. And sometimes by going through this exercise you will discover all kinds of new markets. If you know your customers, understand their needs and wants and methods and fears and similarities and differences, then you will know your market. And your knowledge will be of a kind that is meaningful, deep, and practical.
The Seed Plan: Contents and Style Notes Your seed plan should discuss, in reasonable detail, the three key elements of technology, people, and customers. Explain the technology development plan. Discuss architecture, design, construction. We know the difficulties in scheduling complex projects reliably; that's why we look for developers who understand "best practices," and who have the iron discipline necessary to make excellent use of a few useful control and quality tools. Define the key work packages as far as you can. Sketch the real decision points and the rough schedule. Outline the people and equipment that you will need. Divide responsibility for development among your team. Explain the various practices (daily builds, version controls, reviews, etc.) that you will rely on to ensure that the development process is as controlled as possible. Talk about the risks that worry you the most, and how you plan to confront those risks. If you can, make a basic budget. Here are some tips:
As to style: Avoid business jargon as much as possible. Jargon clouds thinking and obscures meaning. It gives even original ideas a hackneyed, worn feel. Think clearly. Build your case in logical steps. Write crisply, decisively, on the things you truly understand. As Hemingway said: "...write when you know something; and not before; and not too damned much after." Your business plan at the seed stage shouldn't be a book. Truly exciting ideas need only a few pages to sell themselves; the bad ones cannot be sold even with hundreds of pages. While every investor has different requirements and tastes, the following suggestions may also prove useful to you:
Resources Take the time to learn how investors think. Read the "Red Herring" http://www.redherring.com/ and "Upside" http://www.upside.com/ on a regular basis, or skim back issues. Spend time carefully reviewing the literature available on the investment funds you intend to apply to, so that you accurately grasp the criteria of each. Pick up a copy of Geoffrey Moore's Crossing the Chasm, (HarperBusiness, 1991). There are a number of good books available on the writing of business plans; one very good choice for technology startups is Gordon Bell's High Tech Ventures, (Addison Wesley, 1991).
Conclusion The BeOS platform affords numerous possibilities to build fast-growing software companies. The great chance is to create software that couples your own powerful insights with the explosive muscle of the BeOS, for irresistible results. We are interested in meeting Canadian BeOS developers who have truly exciting software ideas, but who lack the capital and management support to get properly underway. Canada is home to thousands of developers who have spectacular strengths in digital media and animation. If you are in Canada and want to discuss your own BeOS project, you are invited to contact Keith Bates by telephone (416-861-2282) or e-mail kbates@easternseed.com. If you are thinking about applying to ETSIF, you should visit our site at http://www.easternseed.com/, which authoritatively describes current ETSIF criteria and guidelines, or request a copy of ETSIF's brochure. For developers located in Western Canada, you can visit http://www.westernseed.com/ for information on the Western Technology Seed Investment Fund.
DEVELOPERS' WORKSHOP: addattr, catattr, listattr, rmattr.... By Doug Fulton "Developers' Workshop" is a new weekly feature that provides answers to our developers' questions. Each week, a Be technical support or documentation professional will choose a question (or two) sent in by an actual developer and provide an answer. We've created a new section on our web site. Please send us your Newsletter topic suggestions by visiting the web site at: http://www.be.com/developers/suggestion_box.html.
Q: What's a catattr? -- Alfred Jarry, Fin-de-Siecle, Ohio A. About three days and a box. Seriously, Mr. Jarry has stumbled over one of our undocumented command line tools (in /beos/bin). We'll officially document them someday, but until then, regard... addattr, catattr, listattr, rmattr These tools perform attribute tricks, and are great for attribute debugging. Almost anything that can be done programmatically (through the BNode attribute functions) can be done from the command line with these tools. All four of these tools return 0 upon success, and non-zero otherwise (but with a caveat, as described in rmattr).
|