Archives for Coding

A Tree on the backyard

Posted by ALB42 on 24. April 2015No Comments

The Treeviews are working in principle, just the scrollbars are not in place, The position of them is set too early, before they are created. Besides this the Trees work rather nicely also the shelltreeview. But the Edit has the same problem as in the stringgrid or valueedit. It draws not right, I didn’t find out whats wrong there the edit is completely with text on white background, only at the cursor/selection you can read the char. I still have no idea why MUI paint this in the wrong way, especially because the scrollbars are painted in the right way… very strange.

TreeView1

One Font dialog please

Posted by ALB42 on 23. April 2015No Comments

Worked on the Font Dialog and ToolBar, the toolbar needed some addition work on the theming engine… I’m not completely sure how this theming engine work. Needs some more linux debugging I guess.
The fontdialog is just directly assigned to the ASL works very nicely.

FontDialog1

The Light is high

Posted by ALB42 on 21. April 20152 Comments

The SynFacialHighlighter seems not to work on AROS, because no WideStringmanager is available, one way would be to write a Widestring manager (maybe would be good idea to do so also for the basic Freepascal implementation) or search for a different customizable highlighter. I found already one (included in Lazarus) SynUniSyn. The main problem is that this is just a very basic port from the delphi SynUniSyn and the original SynUniSyn is very hard to find (at least the original Pages are down, and sourceforge and so on are empty), so no Highlighter example files available. But I found a very old source of an editor wich have in an older repository version the sources and 311 (!!) Highlighters included.
So it works, also on AROS, maybe some tiny changes must be done, for example the C++ highlighter turns everything into uppercase. But this could be done I think, I will play a little bit with it.

SynUniSyn

Source at Github

Binary AROS i386

Smile Screen

Posted by ALB42 on 20. April 2015No Comments

Implemented Screenshot possiblity for AROS, works very nice. Also found a source, how to make a screenshot
without the windows, the application.Minimize and Restore was long time implemented already but I never tried.

so here the source to create a screenshot:


procedure TForm1.Button1Click(Sender: TObject);
var
  MyBitmap: TBitmap;
  ScreenDC: HDC;
  WrkJpg: TJpegImage;
begin
  Application.Minimize;
  Application.ProcessMessages;

  Sleep(32);

  MyBitmap := TBitmap.Create;
  ScreenDC := GetDC(0);
  MyBitmap.LoadFromDevice(ScreenDC);

  Application.Restore;
  Application.BringToFront;

  WrkJpg := TJpegImage.Create;
  try
    WrkJpg.CompressionQuality := 80;
    WrkJpg.Assign(MyBitmap);
    WrkJpg.SaveToFile('test.jpg');
  finally
    FreeAndNil(WrkJpg);
  end;
  ReleaseDC(0, ScreenDC);
  FreeAndNil(MyBitmap);
end;

and the resulting Image:
test

LazPaint working

Posted by ALB42 on 20. April 20154 Comments

Finally go LazPaint somewhat working, yesterday was just with many dummy functions in the bgrabitmap package. Today I wrote some implementations of this. It works, but it is VERY slow, because the drawing functions like WritePixelArray are very slow when drawing to a ARGB Screen. Maybe a clever conversation before will improve it. the other thing: it crashes very often, mostly List exceptions, I’m wonderring if thats the same as I got for EdiSyn, some fonts are too small to read.

LazPaint01

Tabs n Pages

Posted by ALB42 on 19. April 2015No Comments

Worked at my idea for the visible Tabs at the Pagecontrol. As I found out before the Register at MUI can not be changed on runtime, so hard to use it directly for the LCL Pagecontrol. But now I just add a second MUI Object above the Pages which only contains the Register. Rather the same schema I used for the Caption of Checkboxes.

TabControl

TAChart tests

Posted by ALB42 on 17. April 2015No Comments

I played a little bit with the TAChart, omg so many different units needed, so many components/pathes to set. Some inital drawing problems, some more error checking need. Now works nicely, of course some events and so on does not work.
This new TAChart is very different as the one I used long time before in my programs in university. So I’m not sure how to use this but in principle it works 😉
Made a little test program afunction plotter:

Download: TAChartTest

TAChartTest

Testing 3rd party applications

Posted by ALB42 on 16. April 2015No Comments

To debug the lcl more I tested some 3rd party lazarus applications, some of them are really bad made. So my LCL get some problems with Autosize, especially when the window is Autosized and sizeable at the same time (which sounds a little bit strange for me also)

WinFF

WebPage

Problems:
Statusbar still crashes, so I had to remove it, still no idea whats wrong there. Funny, after removal of Statusbar it still compiles, so it was not in use?.
Autosize setting of the main window, as described already. First it get some exceptions because the defaultsize was not set, thats right I didn’t set this things. It seems some alignment problems alao related to this. So now I made a very simple implementations set the Prefered Size to 20×20. Later should add some for every widget.
Besides this problems the program work, but inside many ifdef unix, ifdef windows so much work need to implement startup of programs and so on.

WinFF

This ffplay is already called as expected. (just the ffplay is strange, crashes often and plays much to fast). The convert is done via a script with is very nice and easy to bring to AROS. But sadly the ffmpeg has some problems: First it’s not made for amiga so a source defined with „System:test/test.avi“ will not work because ffmpeg will report „Error: Unknown protocol System“ so one have to use „file:System:test/test.avi“ or so. But even then its not working, unrecognized options everywhere, maybe its made for an other ffmpeg version, I did not find for which ffmpeg its made.

Lyapunov Fractal

I really liked this fractals on AMIGA, even its was VERY slow to calculate (and its still, even on this fast computers), but they look better, different than the mandelbrot, julia or so. I found a rather complex program to calculate it, for Delphi, but converting to lazarus and some tiny changes and it also works on Lazarus, some more changes also works on Linux. now to AROS.

Problems:
Mainproblem is the Tabcontrol which still does not allow to switch tabs, so I had to add some Buttons for navigation and like always some drawing problems. Especially, Editpanels behave strange sometimes. I have to check later.

Download: Lyapunov for AROS i386

Lyapunovia

Example saved images:

JellyFish

LazSokoban

This worked surprisingly well, biggest problem was only that the pathes was added a DirectorySeparator even there was already one, no problem for Linux/Windows, but at AROS it means updir. And again some AutoSize issues really need look whats the problem there.
In contrast to the lazman program this is really well programmed, work well and also fast on AROS without any further optimizations. The colors are so also in the origian not a colorbug (I had to check twice, could not believe someone make such colors by purpose)

Download: LazSokoban
(AROS i386 – inclusive Source)

lazsokoban