Custom cursors do not work on ubuntu lazarus / 39-Graphics ---------------------------------------------------------------------- circular · 2011-02-21 20:55 With LazPaint, when trying to change the cursor on ubuntu to a custom ICO cursor, the program crashes.  What can be done about it ? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit ucursors; {$mode objfpc}{$H+} interface uses  Classes, SysUtils; const     crCustomColorPicker = 1;     crCustomCrosshair = 2;     crCustomFloodfill = 3;     crCustomRotate = 4; implementation uses Graphics, Forms, LResources; var colorpickerIcon,    crosshairIcon,    floodfillIcon,    rotateIcon : TIcon; initialization {$I paintcursors.lrs} colorpickerIcon := TIcon.C reate;colorpickerIcon.LoadFromLazarusResource('colorpicker');screen.Cu rsors[crCustomColorPicker] := colorpickerIcon.Handle; crosshairIcon := TIcon.Create;crosshairIcon.LoadFromLazarusResource('crosshair');screen .Cursors[crCustomCrossHair] := crosshairIcon.Handle; floodfillIcon := TIcon.Create;floodfillIcon.LoadFromLazarusResource('floodfill');screen .Cursors[crCustomFloodfill] := floodfillIcon.Handle; rotateIcon := TIc on.Create;rotateIcon.LoadFromLazarusResource('rotate');screen.Cursors[ crCustomRotate] := rotateIcon.Handle;end. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   case GetCurrentTool of  ptHand, ptMoveSelection: wantedCursor := crSizeAll;  ptRotateSelection: wantedCursor := crCustomRotate;  ptPen,ptRect,ptEllipse,ptSelectRect,ptSelectEllipse: wantedCursor := crCustomCrosshair;  ptColorPicker: wantedCursor := crCustomColorPicker;  ptFloodFill: wantedCursor := crCustomFloodfill;  ptSelectPen: wantedCursor := crHandPoint;  else wantedCursor := crDefault;  end;  if cursor <> wantedCursor then Cursor := wantedCursor; ---------------------------------------------------------------------- Marc · 2011-02-22 22:34 bugreport ? ---------------------------------------------------------------------- circular · 2011-02-23 16:24 Ok. I can't find LCL category in the bugreport form. ---------------------------------------------------------------------- DirkS · 2011-02-23 17:11 Quote from: circular on February 23, 2011, 05:24:32 pmOk. I can't find LCL category in the bugreport form. If you choose Lazarus as the project it should be in the Category dropdown. Gr. Dirk. ---------------------------------------------------------------------- circular · 2011-02-23 18:49 Ok, thanks. ---------------------------------------------------------------------- rjharris · 2011-03-02 02:00 This was the issue I was having in Ubuntu. Fixed. Thanks. ---------------------------------------------------------------------- circular · 2011-03-02 18:46 For those who look for the solution, it is to use CUR files, and LoadCursorFromLazarusResource which is in the Graphics unit. The bugreport discussion and examples are here: http://bugs.freepascal.org/view.php?id=18812 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit ucustomcursors; {$mode objfpc}{$H+} interface uses  Classes, SysUtils; var   crCustomColorPicker : integer = 1;   crCustomCrosshair : integer = 2;   crCustomFloodfill : integer = 3;   crCustomRotate : integer = 4; implementation uses Graphics, Forms, LResources, Controls; initialization   {$I paintcursors.lrs}   screen.Cursors[crCustomColorPicker] := LoadCursorFromLazarusResource('colorpicker');  screen.Cursors[crCustomCrossHair] := LoadCursorFromLazarusResource('crosshair');  screen.Cursors[crCustomFloodfill] := LoadCursorFromLazarusResource('floodfill');  screen.Cursors[crCustomRotate] := LoadCursorFromLazarusResource('rotate'); end.