-
Posts
618 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Posts posted by Frederick
-
-
I write applications for the desktop but at times, I want to design a form (using desktop controls) that will fit within a mobile phone's screen, with vertical scrolling only.
What is the best way to do this? Are there examples I can look at?
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1560)
-
In my ServerModule's OnHttpCommand event, will the calling server receive a 200 response code if set it without setting Handled=True?
procedure TUniServerModule.UniGUIServerModuleHTTPCommand(
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo;
var Handled: Boolean);
begin
AResponseInfo.ResponseNo:=200;
// Handled:=True;
end;I want to do this because I need to perform some extensive processing with the received parameters in the Main Form.
Additionally, I see that there is a command for UniSession.AResponse.Responseno:=200 that can be used in a session. What does this do for the calling server?
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1560)
-
Thanks for the detailed explanations. I am clear now.
-
I translated the CURL script at https://curlconverter.com/#javascript and the following was returned.
fetch('https://www.mydom.com/api/v2/inv', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'Basic ' + btoa('somekey:')
},
body: 'description=Some Payment'
});Does this look OK?
-
Using the translator returns the following code:-
var url = "https://www.mydom.com/api/v2/inv";
var xhr = new XMLHttpRequest();
xhr.open("POST", url);xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
console.log(xhr.status);
console.log(xhr.responseText);
}};var data = "description=Some Payment";
xhr.send(data);
I suppose that the above code is to be inserted within a UniSession.AddJs() call.
However, where has the "-u somekey:" gone to?
-
I have the following CURL script which responds with a JSON string.
curl https://www.mydom.com/api/v2/inv \
-u somekey: \
-d description="Some Payment"How do I translate the above to JS and where to I read the JSON string?
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1560)
-
Thank you for the detailed explanation.
It would appear that the only way I can avoid purchasing multiple CALs in an office network is to host the UniGUI application in a public VPS.
Would setting up a computer in the office as a cloud server and having users in the office and outside access it via a public IP address avoid the need to purchase multiple CALs as well?
-
If I have a Windows Server Standard Edition installed in a server in a local area network and running a VCL application and 50 users want to access it, I need 50 CALs.
If I use a UniGUI app from a VPS with Windows Server Datacenter, I don't seem to need to purchase 50 CALS if I have 50 users connected to the app.
If I use a UniGUI app from a computer running Windows Server Standard Edition in a local area network, do I need to purchase 50 CALS if 50 users need to use it?
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1560)
-
Thanks for adjusted code. I wouldn't in a million years figured how to create it.
-
17 minutes ago, Sherzod said:
Yes, because you are reassigning the event here, and there is no ajaxRequest:
I dunno since I followed Hayri's reply in this post. Where should I put the code then?
-
Here is the testcase. Click on the TUniSpeedButton but there is no dialogue box displayed. The text in the TUniEdit control is copied to the clipboard however.
-
Sure, I'll attach one later.
-
51 minutes ago, Frederick said:
In the OnAjaxEvent of the button, I have the following:-
if SameText(EventName, 'customEvent') then begin
ShowMessage(Params['name'].AsString + ' ' + Params['width'].AsString);
end;I changed the following code and even the event name is not shown:-
showmessage(EventName);
{
if SameText(EventName, 'customEvent') then begin
ShowMessage(Params['name'].AsString + ' ' + Params['width'].AsString);
end;}
-
In the form's OnCreate event, I have the following code:-
spdCopy.ClientEvents.ExtEvents.Values['click']:='function click(sender, e, eOpts) '+
' { '+
' var textarea = document.getElementById("'+edtPaylink.JSName+'_id-inputEl"); '+
' textarea.select(); '+
' try { '+
' var successful = document.execCommand(''copy''); '+
' if(successful) var text=''Copied!''; '+
' else var text = ''Unable to copy!''; '+
' } catch (err) { '+
' var text = ''Unsupported Browser!''; '+
' } '+
' }';
In the TUniSpeedButton's ClientEvents.ExtEvents's click event, I have the following code:-
function click(sender, e, eOpts)
{
ajaxRequest(sender, 'customEvent',
{
name: sender.text,
width: sender.getWidth()
}
);
}In the OnAjaxEvent of the button, I have the following:-
if SameText(EventName, 'customEvent') then begin
ShowMessage(Params['name'].AsString + ' ' + Params['width'].AsString);
end;
There is no message shown after the button is clicked. What am I missing here?
-
1 hour ago, Sherzod said:
Hello, you can use js alert method or send a request to server using ajaxRequest method.
Thanks. I replaced "console.log()" with "alert()" and the dialogue box is shown but it is ugly. Is it possible to change it so that it displays like a ShowMessage() or using SweetAlert()?
-
On 12/16/2016 at 2:01 PM, Hayri ASLAN said:
btnCopyToClipboard.ClientEvents.ExtEvents.Values['click']:='function click(sender, e, eOpts) '+ ' { '+ ' var textarea = document.getElementById("'+memSummary.JSName+'_id-inputEl"); '+ ' textarea.select(); '+ ' try { '+ ' var successful = document.execCommand(''copy''); '+ ' if(successful) console.log(''Copied!''); '+ ' else console.log(''Unable to copy!''); '+ ' } catch (err) { '+ ' console.log(''Unsupported Browser!''); '+ ' } '+ ' }';
I use the above code to copy a TUniEdit text property to the clipboard. How do I notify the user by way of a dialogue box upon completion instead of logging it to the console?
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1560) -
3 hours ago, Marlon Nardi said:
Thanks for the feedback!
I will review the installer, there are really few users who use 64 bits.You are welcome.
May I suggest the following improvements:-
- Since the installer removed my library path to the SOURCES directory before installation, it should set it back after
- There is no point in creating the UniFalcon\Lib\Delphi\LibD26x64 if it is going to be empty
- Since the manual installation of the package is required, display it prominently in the dialogue box when the installation is completed
- You may want to create an INSTALL.TXT file that contains installation instructions for new and existing users
-
I managed to get the installation working by doing the following:-
1. Open the package file for Delphi 10.3 Rio and installed the components. (Missed the post-installation instructions in the installer) I was also confused why the installation of the components was carried out when the platform was Windows 32 bit in Delphi although I selected Win 64 bit for the platform during installation.
2. Added a library path to the SOURCES directory
- 1
-
Hi Marlon,
I ran the installer and selected Win64 as the platform and Delphi 10.3 Rio as the Delphi version. After installation, the sub-directory of UniFalcon\Lib\Delphi\LibD26x64 is empty.
If I perform the installation again using the same parameters as above, UniFalcon\Lib\Delphi\LibD26 contains files but UniFalcon\Lib\Delphi\LibD26x64 still contains nothing.
My 64 bit program now cannot compile because Delphi is complaining that files are missing.
What do I do now?
-
Hi Marlon,
I downloaded the latest components and in the Packages sub-directory, there is no TUniFalcon26.dpk file but it is in my current directory. I believe this package file is for Delphi Rio, which I use.
How do I update my current UniFalcon installation to the latest version?
BTW, where is the package file for Delphi 10.4 Sydney?
-
6 hours ago, Frederick said:
I'll upload a test case later.
Here is the test case.
What I am trying to achieve is that when I click "Go To Menu 1", menu 1 is focused and the showmessage for menu 1 is displayed.
-
27 minutes ago, Sherzod said:
Hello,
Sorry, could you please explain in more detail?
I'll upload a test case later.
-
I have a TUniTreeMenu with the SourceMenu property pointing to a TUniMenuItems control.
TUniMenuItem
-> menuitem1
-> menuitem2
-> menuitem3If I am on menuitem3, how do I set focus to menuitem1 and then run the code in menuitem1's OnClick event?
I tried menuitem1Click(menuitem1) but it does nothing.
--
Frederick
(UniGUI Complete - Professional Edition 1.90.0.1558)
-
10 hours ago, Marlon Nardi said:
so you're going to go back to using it, because we're going to solve these points. 🤜. 🤛
Sure.
How To Design A Form That Will Fit Within A Mobile Phone's Screen?
in General
Posted
Thanks for your suggestion.
I would prefer re-design the form myself because