Jump to content

RobYost

uniGUI Subscriber
  • Posts

    207
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by RobYost

  1. How do I gray out a TUnimbutton (Mobile) when enabled = False?
  2. Cross-posted to Code Samples (http://forums.unigui.com/index.php?/forum/15-components-and-code-samples/) there is some good stuff in there, and I don't go there enough to see what's new. https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format I started a wiki with some of the Utilities that I wrote. I think anyone should be able to edit it if they want to add to it or extend / fix any utilities.
  3. https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format I started a wiki with some of the Utilities that I wrote. I think anyone should be able to edit it if they want to add to it or extend / fix any utilities.
  4. I can't make this work with mobile edit (TUnimEdit) Do you know if it possible to make this work? I also incorporated the validators into a component. Here is the source: http://unigui.miraheze.org/wiki/TuniEdit
  5. // ============================================================================= function rtnAllParms(): String; var i: Integer; p: String; begin for i := 0 to UniApplication.Parameters.count - 1 do begin p := p + '&' + UniApplication.Parameters[i]; end; Result := p; end; //This way you can pass a parameter without '=true' //example: www.xxx.com?Demo&LoadData // if(ParmExists('Demo') then DoSomething // ============================================================================= function ParmExists(aParm: string): Boolean; var i: Integer; begin Result := False; for i := 0 to UniApplication.Parameters.count - 1 do begin if (UpperCase(aParm) = UpperCase(Copy(UniApplication.Parameters[i], 1, Length(aParm)))) then begin Result := True; Break; end; end; end; // ============================================================================= function DeleteParm(aParm: string): Boolean; var i: Integer; begin Result := False; for i := 0 to UniApplication.Parameters.count - 1 do begin if (UpperCase(aParm) = UpperCase(Copy(UniApplication.Parameters[i], 1, Length(aParm)))) then begin UniApplication.Parameters.Delete(i); end; end; end;
  6. DelphiDeveloper - I think what Jahlxx is trying to say is: In Delphi, if you get an error message (from showmessage, etc.) you can click CTRL-C and the message is copied to the clipboard. This doesn't work with UniGui messages. ----------------------------- One solution I just thought of. procedure MyShowMessage(aText: String); begin Clipboard.AsText := aText; ShowMessage(aText); end; I just typed this code in. I didn't test it. It is just an idea.
  7. RobYost

    A Suggestion

    This is not a complaint I am very happy with UniGUI, BUT it seems there are many times I get on the support forum and ask how to do something and the answer is I have to do it in JavaScript. DelphiDeveloper goes to the trouble to answer the question for example: But really wouldn't it have been easier for everyone if he just added this code to the constructor of UnimCustomLabel? I changed the constructor, and it works (just as a test, I know it will go away next release. constructor TUnimCustomLabel.Create(AOwner: TComponent); begin inherited; Width := 225; Height := 23; ClientEvents.UniEvents.Add ('afterCreate=function afterCreate(sender) '#13#10'{'#13#10' var me = sender;'#13#10' me.element.on("tap",'#13#10' function() {'#13#10' me.fireEvent("click");'#13#10' }'#13#10' )'#13#10'}'); end; This is just an example. The font properties are ignored on mLable. I added the code DelphiDeveloper supplied to the Update function and it also works. It just seems to me it would be just as easy to add this functionality than it would be to send me JS code to fix it, then you won't be asked that question again because I see people (including me) ask the same question again.
  8. When I rotate my phone when using the android app I wrote it goes back to the sign in form. If I rotate while in a browser it does not. My android app is very simple it only has one control on it; a WebView. Does anyone know where to start looking? Or is there a setting in UniGui that will disallow the restart. I have an option on my main form to log out, so if I could disable it elsewhere.
  9. Add the two lines to MainActivity.java package com.simple_landlord.simplelandlord; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; ​<====Add this line public class MainActivity extends ActionBarActivity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(R.id.activity_main_webview); WebSettings webSettings = mWebView.getSettings(); mWebView.setInitialScale(1); mWebView.getSettings().setLoadWithOverviewMode(true); mWebView.getSettings().setUseWideViewPort(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient()); <====Add this line mWebView.loadUrl("https://secure.simple-landlord.com/m"); } }
  10. on my mobile app I have two menu items 1. Go to Full Site UniSession.UrlRedirect(URL); 2. Logout (Which takes you to the login screen) UniApplication.Restart; Both of these work correctly on my phone while in a browser. But when I created an android app that only has one component on it, a WebView <WebView android:id="@+id/activity_main_webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> They do nothing when clicked. I don't really know how WebView works, but it looks like I need to send something different to WebView to get it redirect.
  11. RobYost

    NestedList

    OK. I will implement this some other way
  12. Got it working...I had uploaded an older apk. I need to figure out how to upload to google store, but I think I am almost there. Hope this helps someone. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.simple_landlord.simplelandlord"> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppFullScreenTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> styles.xml <resources> <style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style> </resources> activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.simple_landlord.simplelandlord.MainActivity"> <WebView android:id="@+id/activity_main_webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </android.support.constraint.ConstraintLayout> build.gradle dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.0.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' } MainActivity.java package com.simple_landlord.simplelandlord; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; public class MainActivity extends ActionBarActivity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(R.id.activity_main_webview); WebSettings webSettings = mWebView.getSettings(); mWebView.setInitialScale(1); mWebView.getSettings().setLoadWithOverviewMode(true); mWebView.getSettings().setUseWideViewPort(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("https://YOUR_URL/m"); } }
  13. RobYost

    NestedList

    I tried that, but it made no difference.
  14. Mohammad: I went back to my Android Studio and ran it and it worked in the emulator. I don't know much about android apps, so what I did was email the apk file to myself. On my phone, I opened the attachment and clicked install. It added an app on my phone, but when I click on it pops up a message: SimpleLandlord has stopped X Close Any ideas?
  15. Mohammad: I've tried Android Studio but I couldn't get it to work. I will look back and see what the problem was, it was a few months ago. Dan: I have XE6 and it won't make an app for the current release of Android. At this point, I can't afford to update to the latest version of Delphi.
  16. RobYost

    NestedList

    I have attached the whole test project but this is the main code. unit Mainm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, uniGUITypes, uniGUIAbstractClasses, uniGUIClasses, uniGUImClasses, uniGUIRegClasses, uniGUIForm, uniGUImForm, uniGUImJSForm, uniGUIBaseClasses, uniTreeView, unimNestedList, uniButton, unimButton; type TMainmForm = class(TUnimForm) nl1: TUnimNestedList; btn1: TUnimButton; procedure btn1Click(Sender: TObject); procedure UnimFormShow(Sender: TObject); procedure nl1LeafClick(Sender: TObject); private public { Public declarations } end; function MainmForm: TMainmForm; implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication; function MainmForm: TMainmForm; begin Result := TMainmForm(UniMainModule.GetFormInstance(TMainmForm)); end; procedure TMainmForm.nl1LeafClick(Sender: TObject); begin MessageDlg('Leaf Clicked', mtInformation, [mbOK]); end; procedure addItems(nl: TUnimNestedList); var n1, n2, n3: TUniTreeNode; begin n1 := nl.Items.Add(nil, '11111'); n2 := nl.Items.Add(nil, '22222'); n3 := nl.Items.Add(nil, '33333'); nl.Items.Add(n1, 'aaaa'); nl.Items.Add(n2, 'bbbb'); nl.Items.Add(n3, 'cccc'); end; procedure TMainmForm.btn1Click(Sender: TObject); begin; // only the first item of the list when clicked goes to its subitem. addItems(nl1); end; procedure TMainmForm.UnimFormShow(Sender: TObject); begin // Uncomment below and you will see it works correctly // addItems(nl1); end; initialization RegisterAppFormClass(TMainmForm); end.
  17. Thanks, That works. I thought it said to do 1 OR 2, not 1 AND 2. Your instructions were clear, but I misread them.
  18. That seems to make a VCL or FMX application. I need an iPhone App and an Android App.
  19. RobYost

    NestedList

    if I add code to the form show I am able to add subItems procedure TMainmForm.UnimFormShow(Sender: TObject); var n1, n2, n3: TUniTreeNode; begin n1 := nl1.Items.Add(nil, '11111'); n2 := nl1.Items.Add(nil, '22222'); n3 := nl1.Items.Add(nil, '33333'); nl1.Items.Add(n1, 'aaaa'); nl1.Items.Add(n2, 'bbbb'); nl1.Items.Add(n3, 'cccc'); end; Clicking on 1 goes to a; 2 goes to b etc. but if I put the very same code in a button procedure TMainmForm.btn1Click(Sender: TObject); var n1, n2, n3: TUniTreeNode; begin n1 := nl1.Items.Add(nil, '11111'); n2 := nl1.Items.Add(nil, '22222'); n3 := nl1.Items.Add(nil, '33333'); nl1.Items.Add(n1, 'aaaa'); nl1.Items.Add(n2, 'bbbb'); nl1.Items.Add(n3, 'cccc'); end; clicking on 1 goes to a, but clicking on 2 and 3 trigger OnLeafClick and have no subitems
  20. I think I remember a thread that addressed this, but I can not find it. I want to create an iPhone app and an Android app that just goes to my website that runs my UniGui application. Does anyone know the easiest way to accomplish this? I have tried some of the free app builders, with limited success. People want to download an app not navigate to a web page, or add a shortcut to their phone, plus it is another way to advertise. Thanks, Rob
  21. I tried using the TUnimButton I changed the iconcls to 'hamburger' (with out quotes) and the button is blank. If I use one of the ones in the list like 'more' it does work. also, is there a list of the pictures of what each icon looks like anywhere?
  22. I am also using OVH, and have been very happy with it. It is hard to compare prices with contabo because you can't create exactly the same systems. I use uptimerobot and it has not gone down that wasn't me stopping my program. OVH is in both North American and Europe so I ended up going with them.
  23. Thanks, Eduardo, That fixed it. Hayri, I couldn't find sweetalert.js but I did have sweetalert2.min.js and sweetalert2.common.js I didn't try copying them, I moved the whole folder and it worked. Thanks for the help.
  24. I added Sistema Fenix to my project to use the Sweet Alert component. It works fine on my development machine, but when I put on my server I get: Ajax Error swal is not defined swal({ title: 'Demo', html: 'Account Information not available in Demo mode', type: 'info', showConfirmButton: true, showCancelButton: false, confirmButtonText: 'OK', cancelButtonText: '', animation: true, allowEscapeKey: false, confirmButtonColor: '#BDBF37', cancelButtonColor: '#d33', timer: 0, allowOutsideClick: false }); swal is not defined
  25. Yes, I only had one field that needed this.
×
×
  • Create New...