Horizontal Scroll Bars

Dave Mitchell

Member
Licensed User
As a new B4PPC owner, I am looking forward to writing some code. I am trying to display text in a multiline textbox, but I don't want the text to wrap. Is there a way to active a horizontal scroll bar in place of wrapping the text?

Thanks, dave
 

Dave Mitchell

Member
Licensed User
Excellent, thank you so much. Is there documentation on the door library? I poked around the Microsoft site but clearly don't know what I am looking for -> Thanks agraham, I found it on your post in the door library thread "If anyone wants to play but doesn't know how to find the necessary information the .NET 2.0 Class Library docs are here http://msdn2.microsoft.com/en-gb/lib...35(VS.80).aspx"

I was also looking for a way to find installed fonts. I can get the font filenames (cour.ttf, etc.), but not the name to pass to the setfont routine (Courier) -> I may have found it in the door lib as fontFamilies(j).Name, I'll see if I can get it to work.

Thanks again for the time you took answering my question.

Dave
 
Last edited:

alfcen

Well-Known Member
Licensed User
The door library is growing to a huge gate :)
This library tied in to the IDE would probably allow selection of
properties and events for given controls within the IDE while
the compiler wraps the "door" into the executable.
Well, atheoretical thought, I'm not a C programmer.
 

agraham

Expert
Licensed User
I'm afraid that things don't work that way Robert. There is nothing that this library can do that could not be done more efficiently at design/compile time in the IDE should Erel choose to implement it.

This library is of use only at runtime. It takes advantage of a .NET feature called "reflection". Basically every .NET "assembly" (dll or exe) carries a description of what it includes in a set of "metadata" within itself. This metadata can be accessed by a program at runtime to find out what objects, methods and properties are included in the assembly. By this mean new objects from that assembly may be instantiated and the methods and properties of those existing and new objects accessed.

This can be loosely described as "dynamic programming" or "late binding" and it comes with a performance cost as rather than being tightly bound and efficiently pre-compiled this library has to search for each property and method before invoking it, and that invocation has to do further work to coerce the arguments of that method or property call into the correct type. This comes at quite a cost in performance so is better suited for one-off types of access such as defining a controls' style rather than e.g. incrementing a property in a loop.

The above barely touches on a large subject and the knowledgeable could quibble with the huge simplifications I've made in the above description, but in the context of the use of this library it is largely accurate.
 

alfcen

Well-Known Member
Licensed User
Sacrificing performance is painful in more ways than one.
Nevertheless, the door library is a great performer in applications
where, say, 2 or 3 controls need additional properties.

I used your example of adding a horizontal scroll bar and text wrap
control to my Text Editor and, oh boy, it looks much more professional
with just four more short lines of code.

Thanks so much for your kind, comprehensive tutorial, Andrew.
 

agraham

Expert
Licensed User
I was also looking for a way to find installed fonts. I can get the font filenames (cour.ttf, etc.), but not the name to pass to the setfont routine (Courier)
Some what belatedly I attach a bit of code showing how to display a Font Selection Dialog and assign the chosen font to a control. This only works on the desktop and of course needs the Door library. My example in the Door thread http://www.basic4ppc.com/forum/showpost.php?p=11133&postcount=16 has a Font object example.
 

Attachments

Last edited:
Top