Download presentation
Presentation is loading. Please wait.
Published byJuliet Baker Modified over 9 years ago
1
Lessons Learned (from the Simple HTML Editor) A Presentation for the Microsoft Access SIG of the North Texas PC User Group by Larry Linson. © Copyright 2000 by L.M. Linson, all rights reserved
2
Specifications u Prepare a Microsoft Access database u Simple text editor for SIG Leader u Allow addition of new records u Allow deletion of existing records u Allow editing of new and existing records
3
Specifications u Automate insertion of HTML markup – for paragraph – for break (new line) – for bold – for italic – for link or anchor u Supply appropriate ending markup
4
The Plan... u Main form allows: –Display –Selection –Addition –Deletion –Editing u Click button for function
5
The Plan, cont’d u Popup Form for Link –Universal Resource Locator (URL) –Option to open in new Window –Text to be displayed u Anchor markup deferred (not to be done)
6
Seems Simple Enough... u Combo Box for Selection u Text Box for Title / Identification u Text Box for Date (default to Today) u Text Box for HTML Text u Buttons for Add, Delete, Close, Markup
7
Seems Simple Enough, cont’d u Processing markup – when a Markup button is clicked – use the Text Box.SelStart and.SelLength properties to – Split the text, – Insert the beginning markup, »precede by new line if or – Reinsert highlighted text, if appropriate, – Insert the ending markup, if appropriate, – Append the remainder of the original
8
Seems Simple Enough, cont’d u Processing a Link – When the Link button is clicked – Open the popup, dialog Form – Text Box for URL – Disabled Selection, Text Boxes for Anchor – Text Box for Display Text – OK Button – Cancel Button
9
Seems Simple Enough, cont’d u Processing a Link – Display the highlighted text in URL Text Box – Display the highlighted text in Display Text Box »if no text was highlighted, leave both empty – Allow Cancel – If OK, create a link of the form Site Name –where href contains contents of URL Text Box –“Site Name” is contents of Display Text Box
10
Seems Simple Enough, cont’d u When done with any markup, return the cursor u To the HTML Text Box on the main Form u With the originally highlighted text still highlighted u Except, if a Link, with the Display Text highlighted
11
Let’s Take a Look at how the SIG Leaders HTML Editor turned out
12
First Lesson Learned u When you move off a TextBox – Highlighting vanishes – No SelStart – No SelText u Workaround – Save SelStart and SelText in the LostFocus event
13
Another Lesson Learned u When you store modified text – Back into the text box – You are back at the beginning – Nothing highlighted u Workaround – Modify the saved SelStart and SelText values and reset them so the same text is highlighted as before the markup
14
Side Lesson u When you reset the SelStart and SelText – Highlighted code will be visible – But not where you left it positioned – May be at bottom of box u Workaround – I couldn’t find one
15
Yet Another Lesson Learned u Vanishing highlights – If the modal popup dialog had been used – Sometimes no SelStart and SelText – Why? I didn’t figure it out! u Workaround – Save SelStart and SelText values in the KeyUp event instead of Lost Focus
16
Conclusion u There are some unobvious stumbling blocks u There are workarounds for most u There are no workarounds for a few u You can write an editor in Access BUT u There are probably better tools for writing editors
17
Thank you Thank you for your kind attention Please come again u And, please... –Gently wake your neighbor before leaving
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.