Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Graphics / Re: May be useful to somebody
« Last post by Handoko on Today at 07:35:48 am »
2
Graphics / Re: How can I draw a rectangle onto an image of a ScrollBox?
« Last post by Handoko on Today at 07:30:55 am »
But I will publish my application if it will be done and you will see better its structure.

Any news about the application? I am curious to see what you're currently working on. Some screenshots maybe.
3
General / Re: Draw a line in the ScrollBox ?
« Last post by Handoko on Today at 07:27:54 am »
Is it possible to draw a line in the scrollbox with the onclick event and make it moveable?

To achieve it, basically you need to solve these 3 things:

1. Draw the lines
This is the easiest. If you don't know how to do it, here has an example code showing how to draw lines on a scrollbox's canvas and the canvas of the object inside the scrollbox:
https://forum.lazarus.freepascal.org/index.php/topic,66899.msg513831.html#msg513831

2. Store the lines' information
Because you need to make them moveable, you need to store the basic information of the items. You can write your own data structure for information like: PosX, PosY, color, object_type, etc. And then you can use a dynamic array as the container for storing them. For more advanced usage you can use TList or FPObjectList. Here is a list of the available containers for Lazarus:
https://wiki.lazarus.freepascal.org/Data_Structures,_Containers,_Collections

3. Sprite picking
This is hardest part. Even you got a fully working code, you may still scratch your head for understanding it. If all the items have basic geometry shapes, rectangle for example you need to loop the z-order and compare your mouse position with the shape's left-top most and right-bottom most coordinates. But if they have varies or irregular shapes, you need to use different method. Mr.Madguy provided a fully working code for irregular shape sprite picking technique:
https://forum.lazarus.freepascal.org/index.php/topic,36871.msg246309.html#msg246309

Usually, I would provide a fully working demo but I'm sorry I am very busy recently. I cannot help.
4
  May I please ask you to split that single file into 3 different ones?

Sorry for the late reply.
Here they are.
5
macOS / Mac OS X / Re: Debugger crashes with Apple Silicon code
« Last post by trev on Today at 06:00:08 am »
I found the lldb source code for this error message, but I am none the wiser:

From https://github.com/llvm/llvm-project/blob/883887493c882d656d5da100ee637a348e81357c/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp#L123

Code: [Select]
lldb::ProcessSP PlatformDarwin::DebugProcess(ProcessLaunchInfo &launch_info,
                                             Debugger &debugger, Target &target,
                                             Status &error) {
  ProcessSP process_sp;

  if (IsHost()) {
    // We are going to hand this process off to debugserver which will be in
    // charge of setting the exit status.  However, we still need to reap it
    // from lldb. So, make sure we use a exit callback which does not set exit
    // status.
    launch_info.SetMonitorProcessCallback(
        &ProcessLaunchInfo::NoOpMonitorCallback);
    process_sp = Platform::DebugProcess(launch_info, debugger, target, error);
  } else {
    if (m_remote_platform_sp)
      process_sp = m_remote_platform_sp->DebugProcess(launch_info, debugger,
                                                      target, error);
    else
      error.SetErrorString("the platform is not currently connected");
  }
  return process_sp;
}
6
macOS / Mac OS X / Re: Debugger crashes with Apple Silicon code
« Last post by trev on Today at 05:37:55 am »
Same issue with a new install of Lazarus 3.2.
7
Other / Re: Copyrights Q
« Last post by domasz on Today at 04:56:59 am »
You might want to ask yourself a question- if you paid for the real thing just misplaced it, would it really be such a bad thing to download "backup" from the net? And then visit "amazon" and other "ebays".
8
macOS / Mac OS X / Re: Debugger crashes with Apple Silicon code
« Last post by trev on Today at 04:44:57 am »
Same issue with new install of Lazarus 2.2.2:

Code: [Select]
>> target create /Users/trev/Documents/laz_lnet_smtp/project1.app
(lldb) target create /Users/trev/Documents/laz_lnet_smtp/project1.app
Current executable set to '/Users/trev/Documents/laz_lnet_smtp/project1.app' (arm64).
>> settings clear target.run-args
(lldb) settings clear target.run-args
>> breakpoint set --func fpc_break_error -K false
(lldb) breakpoint set --func fpc_break_error -K false
Breakpoint 1: no locations (pending).
>> breakpoint set --func fpc_runerror -K false
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --func fpc_runerror -K false
Breakpoint 2: no locations (pending).
>> breakpoint set --func fpc_raiseexception -K false
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --func fpc_raiseexception -K false
Breakpoint 3: where = project1`FPC_RAISEEXCEPTION, address = 0x000000010001ae30
>> breakpoint command add 3
>> p/x $x0
>> p/x $x2
>> p ((char ***)$x0)[0][3]
>> p ((char **)$x0)[1]
>> DONE
>> version
(lldb) breakpoint command add 3
(lldb) version
>> breakpoint command add 2
>> p/x $x0
>> DONE
>> version
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) breakpoint command add 2
(lldb) version
>> breakpoint command add 1
>> p/x $x0
>> DONE
>> version
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) breakpoint command add 1
(lldb) version
>> process launch -n
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) process launch -n
error: the platform is not currently connected
>> process kill
>> quit

Also using lldb on the command line works for the Lazarus 2.2.2 program - just a default form1 project1.app.

Curiously, a just compiled Lazarus main branch works without issue as below:

Code: [Select]
>> target create /Users/trev/tmp/project1.app
(lldb) target create /Users/trev/tmp/project1.app
Current executable set to '/Users/trev/tmp/project1.app' (arm64).
>> settings clear target.run-args
(lldb) settings clear target.run-args
>> breakpoint set --func fpc_break_error -K false
(lldb) breakpoint set --func fpc_break_error -K false
Breakpoint 1: no locations (pending).
>> breakpoint set --func fpc_runerror -K false
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --func fpc_runerror -K false
Breakpoint 2: no locations (pending).
>> breakpoint set --func fpc_raiseexception -K false
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) breakpoint set --func fpc_raiseexception -K false
Breakpoint 3: where = project1`FPC_RAISEEXCEPTION, address = 0x000000010001b4d0
>> breakpoint command add 3
>> p/x $x0
>> p/x $x2
>> p ((char ***)$x0)[0][3]
>> p ((char **)$x0)[1]
>> DONE
>> version
(lldb) breakpoint command add 3
(lldb) version
>> breakpoint command add 2
>> p/x $x0
>> DONE
>> version
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) breakpoint command add 2
(lldb) version
>> breakpoint command add 1
>> p/x $x0
>> DONE
>> version
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) breakpoint command add 1
(lldb) version
>> process launch -n
lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
(lldb) process launch -n
Process 56020 launched: '/Users/trev/tmp/project1.app/Contents/MacOS/project1' (arm64)
Process 56020 exited with status = 0 (0x00000000)
>> process kill
>> quit

Prof Googly was unhelpful.
9
General / web development using pascal
« Last post by Nate897 on Today at 02:04:05 am »
Good evening gentlemen,  8-)

I love the FPC. I recently found this interesting video on the Internet, regarding web development using the Pascal language.
Some historical background is discussed in there.
I found it really thought-provoking.

What are your thoughts on the subject?

Sorry if this is not the right place to post this, please move if it's not.
Please discuss.
10
General / Re: questionable function definition display.
« Last post by 440bx on Today at 01:35:28 am »
The font is BorlandTE, filename: BORTE.FON

It's proprietary to Borland and, I think they stopped distributing it long ago.  There is a very similar but not the same font called "Raize" which is available for free on the net.  BORTE.FON was distributed with Delphi 2 (and possibly some of the later versions.)

This place has some interesting fonts as well as comments and screenshots along with an easy to read article about programming fonts https://darinhiggins.com/2012/05/18/best-programming-font/

HTH.

ETA:

@dseligo provided you a link to a reply I gave recently to the same question from someone else.

Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018