Here's an idea for the wishlist, taken from my own programs:
I often use a TextBox as a status/log window. It's very convenient, as you can easily grab the text later for dumping to a file or to a clipboard, as you wish. When trying to tell a user exactly what's happening, a textbox is just a simple and powerful tool - providing your messages are good! ;)
This means that almost every GUI program I've written (all five of them, which is a very small sample set!) have an "AppendText"-style function for testboxes. It just grabs the current text in the textbox, and appends the text.
It's actually more complex than that - you have to check if there's anything there, then append a CR+LF and the text if there isn't, or just set the textbox with the right text if it was blank. It looks something like this:
Function AppendLine (ByVal hWndControl As Dword, ByVal ReportText as String) As Long
Dim oldReportText As String
Dim newReportText As String
Dim newReportLine As String
Dim result As Long
oldReportText = FF_TextBox_GetText(hWndControl)
newReportLine = RTrim$(ReportText)
If oldReportText = "" Then
newReportText = NewReportLine
Else
newReportText = OldReportText + Chr$(13,10) + newReportLine
End If
result = FF_TextBox_SetText(hWndControl, newReportText)
AppendReportLine = result
End Function
(That's from memory, by the way - don't try to compile it! It might not work properly! ;))
Hopefully that gives you the general idea. It's really cool to be able to just call a function and have it append the text.
I doubt everyone will want to RTRIM$ their text, so that could be dropped. I just prefer to have my text trimmed so it doesn't set off scrollbars, but an LTRIM$ will kill any indenting I'm trying to put into my logs!
And I suspect that some error checking might be in order, too... That version just passes any errors from the Set straight back to the user, but does no error checking at all on the Get... :?
Given the way I use textboxes, I'd probably get a fair bit of milage out of having functions named FF_TextBox_AppendLine and FF_TextBox_AppendText (the latter not adding a CRLF before the appended text, obviously.)
Of course, if I already have such functions, you might be asking why I'd want them in FireFly. Simple - I like consistent, easy, functional interfaces. Every time I have to use this in a new program, I just know I'll end up copying it from an old one, which may mean - if I copy it from the wrong program - that I have to keep fixing the same bugs over and over again. Plus, if it's in FireFly, I'll get the nifty ToolTips for it. Which is pretty cool. ;)
Of course, this is just me. So I guess what I'm asking is whether or not anyone else thinks it's a good idea, and - crucially - whether or not they'd use such functions. I'd hate to suggest something none of you are going to use...
I've tried to make a poll of this, which will run for 30 days. But if it doesn't work then just stick a "Yay" or "Nay" on a response I suppose. My ego would like a reason, but it's strictly optional to provide one... :D
Phil
Woohoo! The vote works!
*coughs*
I'll shut up now.
:oops:
I've got an alternate for this that stores the text a little better, takes into account for the edit box limits, scrolls the cursor and all that Jazz. Mine even writes to file, but I can take that out. I'll post it when I get home.