Button class

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
radimpl
Posts: 25
Joined: Sat Nov 28, 2020 6:28 pm

Button class

Post by radimpl »

In help file of Button constructor is:
CONSTRUCTOR(
oOwner,xID,
oPoint, //The origin of the button in canvas coordinates.
oDimension, //The origin of the button in canvas coordinates.
cText,kStyle,lDataAware
) CLIPPER

What is the canvas coordinates?
In help X# is not descriped.
Why is not in X# help file some basic examples?
Why is not X# source samples for basic objects on web?
The only thing missing is a description of how to get this information.

Radim
User avatar
Chris
Posts: 4766
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Button class

Post by Chris »

Hi Radim,

Are you completely new to X#, or are you a former Visual Objects developer, or have inherited an application written in Visual Objects (VO)? Or do you come from a different xBase dialect like FoxPro, Harbour, Clipper etc? The GUI you are using is available for compatibility with VO only, where it is well documented and VO developers are very familiar with it. It was necessary to include this GUI in X#, only in order to make it possible to port VO apps to X# and the documentation about those classes in X# is provided as a quick reference only.

But if you are a new developer in X#, it probably does not make sense to use those classes (which are outdated), instead you should better use what the .Net Framework itself has to provide. So normally you would use Windows.Forms, which are a lot more powerful and are the standard in .Net programming, in all .Net languages (also available is WPF, but that's not as widely used).

So please let us know what your main intention is with using X# (completely new X# developer, xBase language developer, have VO app to port/maintain etc) and we can help by pointing you out the most appropriate way to proceed.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Chris
Posts: 4766
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Button class

Post by Chris »

Hi Radim,

Oh, I just noticed that you have selected XBase++ as your preferred dialect. So are you a an XBase++ developer looking for a way to port XBase++ applications to X#? If that's the case, are your apps using any GUI or are they standard console apps using @SAY...GET commands? We are currently working also on providing a way to turn console apps into windows ones (without changing the original code), so that might be of interested to you, too.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
radimpl
Posts: 25
Joined: Sat Nov 28, 2020 6:28 pm

Re: Button class

Post by radimpl »

I will answer you tomorrow.

Thanks for reply.

radim
radimpl
Posts: 25
Joined: Sat Nov 28, 2020 6:28 pm

Re: Button class

Post by radimpl »

Hi Chris,

I programmed in clipper + XClass library. Then I switched to XBase++.
Now I thought I'll try X#. Almost the same syntax, DBF and SQL support (maybe PostgreSQL in the future).
XBase++ I use only in GUI of course.

I found out that the xbase++ dialect is only partially supported, so I'll try VO. Or should I go to core or rather xbase++?
Is core (xbase++) dialect faster then VO?
What the way you recommended to me.

As for VO, does anyone have the original help files?

Now back to my question.
What is the canvas coordinates?

Thanks, Radim
User avatar
Chris
Posts: 4766
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Button class

Post by Chris »

Hi Radim,

Core, is the "pure" .Net way of using X#, similar to c#. No untyped variables or latebound code (unless you use the Dynamic data type (that comes with .Net), but that's not recommended), normally you would not use clipper style runtime functions, but instead the standard .Net ones (so, instead of Left(), you would use c:SubString(), c:ToUpper() instead of Upper(c) etc) and there are no xBase specific features like codeblocks. Speed is more or less the same as in all dialects.

The VO dialect was designed to make the X# compiler and runtime work as closely as possible to that of VO, offering maximum possible compatibility with it. Same for the other dialects, like XBase++ and FoxPro, we are trying to make X# as compatible as possible with those xBase dialects, when you select those in X#. The VO dialect is the most "complete", meaning we have reached probably like 99% of the maximum possible compatibility with Visual Objects in it.

What are you missing in the XBase++ dialect in X# mainly, it's not compatible enough syntax-wise, the runtime functions are missing or not working correctly, or are you missing the GUI options? For the syntax and runtime functions, we are still improving those, based on XBase++ developers' reports, so if you see some problems, please let us know and we'll probably implement/fix them if it's possible to do it within the .Net rules. Regarding GUI options, we have not worked on anything specific for XBase++ yet, mainly because there has not been enough interest on it yet. But if that changes, we will of course look into that, too.

Regarding canvas coordinates in the VO compatible GUI, that refers to the location on screen (in pixels), relative to the lower left corner of a window. But as you will see, putting controls manually by code does not work so well in this GUI, normally you would put the controls on screen using the visual designer (which is also available in X#). I warned you, this GUI is outdated and has many quirks and problems (we former VO developers had learned to work around them through the years), so I am sure you will find plenty more things that will leave you scratching your head!

May I ask why don't you choose to use Windows Forms for GUI instead? That's the standard in .Net, and can be used from every X# dialect, if that's what concerns you. And if you use that GUI, then you automatically can use also other probably 100s of libraries of custom controls created by 3rd party vendors.

Since you asked for a recommendation, since you are coming from the XBase++ world, I think the best is (at least in the beginning), to use the XBase++ dialect in X#, as this will make you feel more "at home" with the syntax. Later, after you get comfortable with X#, you may choose to use the core dialect. Many VO developers have done exactly that, used the VO dialect for applications they ported from VO, but later used the core dialect for new applications. But that's a personal preference for everyone of course.

So it also depends on what is your primary target. If you intend to port an (or many) existing application from XBase++ to X#, then I think using the XBase++ dialect is the only viable solution, since otherwise you would need to make too many changes to your code (regarding syntax). If you plan to write new applications, it depends on if you want to use xBase specific features like codeblocks etc. If you want that, then again using the XBase++ dialect makes the most sense. If not, you may choose to use Core instead.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
radimpl
Posts: 25
Joined: Sat Nov 28, 2020 6:28 pm

Re: Button class

Post by radimpl »

Thank you for your comprehensive answer.
Finally, we definitely understood the connections.

Given the syntax of XBase++ and the fairly frequent use of CodeBlock, I will therefore opt for Windows Forms with XBase++ dialect.
Did I understand correctly?

By the way, what 3rd party vendor library for Windows Forms do you recommended to me?
You certainly have long-term experience.

Again, Thank you for your response and your time.

Radim
radimpl
Posts: 25
Joined: Sat Nov 28, 2020 6:28 pm

Re: Button class

Post by radimpl »

My understanding is that I will buy a library for Windows Forms and then communicate with it using the X# Xbase++ dialect?

Radim
User avatar
lumberjack
Posts: 726
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

Re: Button class

Post by lumberjack »

Radim,

Windows Forms are part of the .NET framework, no need to buy a 3rd party library.

Johan
______________________
Johan Nel
Boshof, South Africa
User avatar
Chris
Posts: 4766
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Button class

Post by Chris »

Hi Radim,

As Johan said, Windows.Forms is part of the framework, same for WPF (windows Presentation Foundation). To get started, just create a new forms application in X#, and this will give you an empty new window in the designer that you can start experimenting and learning with. Which IDE are you using, VS or XIDE? Just to give you some direct instructions on either of them.

As for 3rd party controls, no need to deal with those yet. Windows.Forms itself has plenty standard controls to do almost everything you need in the beginning. After you are more comfortable using it and want to use more fancy or sophisticated controls, then you can purchase 3 3rd party control library like DevExpress.

And yes, I think using the XBase++ dialect makes the most sense for you. As for the GUI, again it depends on what you want to do. If you want to create new apps, I think Windows.Forms is the best. If you want to port existing XBase++ applications into X#, it might make more sense to look into creating/using a GUI similar to what your apps are already using in XBase++.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply