Before the Selection in a TMemo seems to be a big problem…. in fact it was not I just misunderstood two function of this TextEditor class.. The main problem was not to get or set the selection.. but the style of LCL to set a Selection Start and a End.. MUI expect an x and y Value for start and end…. so the conversion was the main problem.. ok not a big problem just needed some thinking. and.. its done.. now you can set and set the selection inside the TMemo.. hmm seems the TMemo will be by far the feature-richest component
Connected the OnActivate Event for Windows as requested.
As second Task I cared about Timers. The principle is rather easy, I just create an array of the call back routines, with the interval length and the time of last call. The time values are stored in a Type Ttimeval which is a record with two longwords one for second until 1.1.1978 and one for microseconds. When get the current system time you will always get rounded to 10 ms exact value… so why they extended it to microsecond? because they guessed for far far aways future… who knows. Exact timing better than 10 ms is also not possible in Windows (except you decrease the size of a time slice to 1 ms or so) because one time slice is around 15 ms (depends on Windows Version). So this is more than enough for the TTimer component in LCL. The time Interval should be always taken as the MINIMAL time before fire again (can be a little bit more always, like in windows/linux as well)
The screen size values are rather easy to get from the PScreen structure in AROS, but to give them to LCL TMonitor was rather hard work.. i had to step through the gtk-widget to find all calls needed for it. So now it Works… with Forms.Monitor.Width and Height you can read out the screen size.
Also removed a bug in ComboBox.. since my dirty Event hack the OnChange Event was not fired anymore.
The name of the current binary distribution of FPC + LCL for Aros now contains also the Date for a better identification of the last Version and changes. There is always a Link to the current release in the Link section on this Page.
Today i again looked a little bit closer on the Memo component and include some features:
Copy/Paste/Cut/Undo can be called from Program.. not only from the keystrokes already defined in the texteditor component. Additionally the Caret position can be read (Row and Line position) the justification of text can be changed to left, right or center.
seems there is no direct way to mark a text part (just a strange way I currently do not understand) and even NO way to read out what is selected at the moment. so selStart, selLength will be hard to implement
I really think about to replace the EditBox by this TextEditor Component… just limit it to one line.. only some minor changes must be done for it, perhaps later I will try.
Yesterday I included repainting of Components on change size, width or parent (seems the parent still doesn’t work well).. still some crashes of MuiTextedit when creating and call to redraw… seems I must test if it is visible before, then the crashes disappear.
Panels now also usable as grouping component. hard to see where the panel is everything is gray:
deBlob catched me and now we have colors, so all Area descendants can have a color (or even change) (atm only the background color) the style is again (like always in MUI?) rather strange.. you supply a STRING with 32 bit color informations FOR every color so white looks like: FFFFFFFF,FFFFFFFF,FFFFFFFF but of course the information in lcl all only 8 bit per color: FF,FF,FF, easy solution just print four times the red, green and blue value.. seems that is ok… the color looks equal in linux lazarus and Aros program.
The Button 3 is inside of the Panel… but in MUI is drawn over the borders of the Panel (in Linux/Windows not!). but ok normaly nobody should do such things by intention.
Another problem with colors are the special Windows colors (like clBtnFace) which are not really colors but something like colortable entries (depends on the theme for which color it stands).. it can’t be translate to real color. Perhaps later this could be used to also set the special colors in MUI like MUII_ButtonBack and so on.
The bug that assigning a new Text to the TextEditor (instead of loading a text from file) is also removed… should be now as fast as loading from file (only one drawing after all contents is loaded into the object)
Removed a bug about double freed Memory in TListBox.
Added click to TListBox (which seems only work with double click… bug in Zune? The Event is not fired on Single Click even there is a special double click event.. will later try out again)
Windows can now be placed all over the screen… the position will be used at init. It is possible to hide the bordericons or even hide the complete border.. use ButtonStyle.. see picture:
To test if the erroneous Hooks are really the reason for the bug .. i implemented a version which does not use Hooks, but ReturnID.. this is very Bad because the number of Events is limited… its not OOP and some Events will not work i guess (mouse move for example)
I included Events on closing Window (so now a second window can be closed also OnCloseQuery is possible (still not checked but should work) so a question can be fired to close/not close the window)
some little bug fixes for crashing application closing for checkbox/combobox
Last version including this bugfixes (for a aros-exec release some more features should be included first)
I think i have an idea whats wrong with the windows opened later! nothing to do with the window itself.. and also this error messages seems have nothing to do with it.
the Hook which call the opening of the window seems not working well… even I can not explain whats the reason.. I wrote a little Mui only program (so without LCL) and i got the same result.. when i produce a new window inside the button click.. this Window will crash (little bit different behavior, other memory areas).
Then i tried not to use a THook for calling the button press but a application Result (as is used for Quit the program).. and IT WORKS, without any problems… ok this way is VERY bad to use in LCL because very hard to find who made the call (make a separate list?).
Ok as a first tryout I COULD try out tomorrow… hmm or try to find why the Hook makes such bad things… hmm perhaps a gdb debug would help.
Besides this I searching for a bug appearing for Windows not opened at startup, but showed later… there seems a big problem… every Redraw of this window let crash the program (sometimes AROS as well).
With a direct call of MUI in a freepascal program it doesn’t happed.
I found a strange error message when open a TForm in LCL:
[intuition] Invalid pointer value d84ded7b at openwindowtaglist.c, line 295
[intuition] Invalid pointer value d84decaf at openwindow.c, line 129
[intuition] Invalid pointer value d84dece7 at openwindow.c, line 184
something like this… every TForm.Show bring up such error message. Looking into code at the given places it seems the pointer value is out of the heap area thats the reason for this message… but WHY? and WHO? i still didn’t get.. The only thing i can guess, is that the pascal objects or resources could be a reason… both I still have to check.
The first and most important work was Code cleaning and debug messages removal to distribute a very first Version of fpc with some lcl units.
Besides this i played around with recordmyDesktop for linux to make Movies. (Tutorials for fpc/lcl?) with the gui its very nice to use, even the selection of area to record is a little bit difficult, because the preview picture is so small.