Jump to content

RobYost

uniGUI Subscriber
  • Posts

    207
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by RobYost

  1. In Chrome (and probably the other browsers as well) go to Settings->Advanced->Passwords and forms There you will see Autofill settings. In there you will see addresses: with a bunch of addresses (and credit cards), you have filled out on other web pages If you are on a web page that has what chrome thinks is an address it will prompt to put in one the saved addresses. In my case these addresses will never be correct, so I would like to NOT have Chrome prompt with the option to fill in the address fields. From what I found out on the internet if you have a form on a web page and add autocomplete="off" it will not prompt for autocomplete. eg. <form method="post" action="/form" autocomplete="off"> But I don't know how to add a parameter to the <form>. I am assuming that somehow we are generating a HTML form.
  2. Thank you, that works. But I have to call a function every time I want to change the value in code. Is there a way for you to add this to the code, or tell me how to add it to a component derived from TUnimEdit. Here is what I use: https://unigui.miraheze.org/wiki/TmUniRyEdit I tried adding DoOnChange and DoOnEnter, but neither was ever called: protected procedure DoOnChange; override; procedure DoOnEnter; override; ... procedure TmUniRyEdit.DoOnChange; begin inherited; JSInterface.JSCall('setValue', ['1000.00']); end; procedure TmUniRyEdit.DoOnEnter; begin inherited; JSInterface.JSCall('setValue', ['2000.00']); end;
  3. Is there a way to turn off autofill (or maybe called autocomplete) in the application? When filling in the form the browser prompts to autofil the Edit fields on the screen. The information presented to autofill would never be the correct information, so I would like to turn it off in my program. It looks like it can be added to the form property, but I don't know how. <form method="post" action="/form" autocomplete="off">
  4. If you put a TUnimEdit on a form and then change the .Text field the x-clear-icon image disappears. If you make a change to the field with your phone it comes back. But the problem is I want to put a value in the field at form show. This makes the X disappear and the user can not easily clear the field. I was able to reproduce this on your basic mobile demo. procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UnimLabel1.Caption := 'Hello World!'; edt1.Text := '2000.00'; edt1.JSInterface.JSConfig('clearicon', [True]); end; clicking on UnimLabel1 causes the text in edt1 to change to 2000.00 and the x-clear-icon to disappear. I then added the JSConfig line, but I get the following error. >>> Do you know how to fix this problem? <<< --------------------------- Debugger Exception Notification --------------------------- Project basic.exe raised exception class Exception with message 'Config Option: O30->clearicon:true<br/>is refering a previous request,<br/>it's not allowed in AJAX request or JS handler.<br/>Use equivalent Public Property or Method instead.'. --------------------------- Break Continue Help ---------------------------
  5. On my main form, I have some buttons in a toolbar. In some cases, I would like to simulate clicking the first button. I call the buttons code in: procedure TfrmmMain.UnimFormReady(Sender: TObject); This would probably work with a timer with 100ms, but I hate using timers because it seems there is always a case where it doesn't work. (heavy load on server, etc.) >>> How would you implement this? <<< One of the first things done in the button is: if (framEntityList = nil) then framEntityList := TframEntityList.Create(self); --------------------------- Debugger Exception Notification --------------------------- Project SimpleLandlord.exe raised exception class Exception with message 'Dynamic controls can not created at this stage: TUnimContainerPanel'. --------------------------- Break Continue Help --------------------------- if (framEntityList = nil) then framEntityList := TframEntityList.Create(self); ---------------------------
  6. --------------------------- Debugger Exception Notification --------------------------- Project SimpleLandlord.exe raised exception class Exception with message 'Blocking ShowMessage() can not be called here.'. --------------------------- Break Continue Help --------------------------- I do have EnableSynchronousOperation=True I put ShowMessage('aaa'); in UnimLoginFormShow and I get the error message. I tried this in a new project and it works OK. Any ideas what I should look at? My project is getting pretty large so I don't know how to make a subset of the project that fails.
  7. https://unigui.miraheze.org/wiki/Mobile_Version_of_InputQuery The link above tells how to use it. function mInputQuery(aPrompt: string; aTitle: String; var rtnValue: String; InputType: String=''): Boolean; var fModal : TUnimForm; aMsg : TUnimlabel; aInput : TUnimEdit; btnOK : TunimButton; btnCancel: TunimButton; begin result := False; fModal := TUnimForm.Create(UniApplication); fModal.Caption := aTitle; aMsg := TUnimlabel.Create(fModal); aMsg.Parent := fModal; aMsg.Margins.Top := 50; aMsg.Margins.Left := 30; aMsg.Margins.Right := 30; aMsg.AlignWithMargins := True; aMsg.Align := alTop; aMsg.Caption := aPrompt; aInput := TUnimEdit.Create(fModal); aInput.Parent := fModal; aInput.Margins.Top := 50; aInput.Margins.Left := 30; aInput.Margins.Right := 30; aInput.AlignWithMargins := True; aInput.Align := alTop; if (InputType <> '') then (aInput as IUniJSInterface).JSConfig('inputType', [''+InputType+'']); btnCancel := TunimButton.Create(fModal); btnCancel.Parent := fModal; btnCancel.Caption := 'Cancel'; btnCancel.Width := Trunc((UniApplication.ScreenWidth - (2 * aMsg.Margins.Left)) / 2 - (aMsg.Margins.Left / 2)); btnCancel.Top := aMsg.Margins.Top + aMsg.Height + aInput.Height + 20 + (fModal.Height - fModal.ClientHeight); btnCancel.Left := aMsg.Margins.Left; btnCancel.ModalResult := mrCancel; btnOK := TunimButton.Create(fModal); btnOK.Parent := fModal; btnOK.Caption := 'OK'; btnOK.Width := btnCancel.Width; btnOK.Left := UniApplication.ScreenWidth - aInput.Margins.Right - btnOK.Width; btnOK.Top := aMsg.Margins.Top + aMsg.Height + aInput.Height + 20 + (fModal.Height - fModal.ClientHeight); btnOK.ModalResult := mrOk; result := (fModal.ShowModal() = mrOk); rtnValue := aInput.Text; end;
  8. If I understand the problem correctly: UniSession.URL Will return: http://123.123.123.123:8077 or http://123.123.123.123:8077/m if you need all parameters // ============================================================================= function rtnAllParms(): String; var i: Integer; p: String; begin for i := 0 to UniApplication.Parameters.count - 1 do begin if (i = 0) then p := p + '?' else p := p + '&'; p := p + UniApplication.Parameters[i]; end; result := p; end;
  9. Thanks, I've tried it this way, but with this solution, if you click login from my website and you are on a phone you will get the desktop version, from there you would have to click phone version. I wanted a solution that could both auto platform switch and allow the user to switch to a different platform.
  10. I haven't tested this but: .x-form-checkbox { border-color: red; } I opened desktop tools and selected the arrow that lets you click on an element and it shows the style. hope it helps
  11. Could you add a parameter you could pass when calling a UniGUI program that will force Desktop or Mobile when soAutoPlatformSwitch is set to True? I would like to set soAutoPlatformSwitch to true, but in the mobile app, I would like a way to be able to ForceDesktop, because the mobile version does not have all the features that the desktop version does, so the user may want to switch to the desktop version for a while on the mobile. I tried doing this myself with a "?ForceDesktop" parameter and it does work, but if I use URLRedirect in the loginFormCreate I get an error. So I have to put a timer in the login form and do the redirect after a few milliseconds. This pops up the login form, and I don't like using timers this way.
  12. This is how I did it: https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format Basically, I create a new copy of TFormatSettings and use their local setting in it. Then I setup up some types of date formats: MM/DD/YYYY MM/DD/YY etc. Then I call fmtDate ( source is in the link) and it changes MM/DD/YYYY to DD/MM/YYYY or MM/DD/YY to MM/DD/YY depending on what is in TFormatSettings Let me know if you have any questions about the source in: https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format
  13. Thanks that worked. Where can I see the difference between 'UnimDBListGrid' NOT 'UnimDBGrid'?
  14. Thanks, Mohammad, I've attached a test program. It is the demo column sort. With the following added to ClientEvents->ExtEvents->Ext.data.store->load function store.load(sender, records, successful, operation, eOpts) { sender.setGrouper({ groupFn: function (record) { return '<p> Company Name' + record.get('1') + '</p>'; }, sortProperty: '1' }); } DBGrid Column Sort.zip
  15. I am trying to not be a bother to you, but it now comes up like it should, but the DataGrid looks unchanged. From looking at Mohammad's code, I would think that the rows should be replaced with: Company Name Kauai Dive Shop Company Name Unisco Company Name Sight Diver etc... What can I do to make it easier for you to help me? Do you want me to attach the demo project I am using? Am I making a wrong assumption how to replace the DataGrid's row information?
  16. Sorry about the typo. I copied this right out of ExtEvents. But it still hangs on startup. This is using DB Sort Column Sort Demo: C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Touch\DBGrid Column Sort This is the only code I changed in that demo. function store.load(sender, records, successful, operation, eOpts) { sender.setGrouper({ groupFn: function (record) { return '<p> Company Name' + record.get('1') + </p>'; }, sortProperty: '1' }); }
  17. From the above example, I tried this in the Column Resize Demo Project. function store.load(sender, records, successful, operation, eOpts) { sender.setGrouper({ groupFn: funtion (record) { return '<p> Company Name' + record.get('1') + </p>'; }, sortProperty: '1' }); } >>> But the demo project hangs at the very beginning and doesn't load. >>> What did I do wrong? The Sencha documentation for setGrouper is: Ext.define('People', { extend: 'Ext.data.Store', config: { fields: ['first_name', 'last_name'], grouper: { groupFn: function(record) { return record.get('last_name').substr(0, 1); }, sortProperty: 'last_name' } } }); does sender = store? what is in records, successful, operation, and eOpts? Are these concepts for Sencha only or do they work in javascript?
  18. I am interested in how he made the panel at the top of the [My cart] tab. With Share/Edit/Delete/Lock I found the code for that in Ext.data.Store (under ClientEvents) I understand the table part. But I don't understand the sender.SetGrouper. or what Ext.Defer means. function store.load(sender, records, successful, operation, eOpts) { sender.setRemoteSort=false; sender.setGrouper({ groupFn: function (item) { if(item.get('8')=='true') return '<span style="display:none;">'+item.get('0')+'</span>'+ '<table class="tblSlati" style="table-layout:fixed;">'+ '<tr class="spaceUnder">'+ '<td><img height="30px" src="files/images/mshare10.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.showsharethiscart(\''+item.get('0')+'\')"/></td>'+ '<td><img height="30px" src="files/images/medit2.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.friendEditCart(\''+item.get('0')+'\')"/></td>'+ '<td><img height="30px" src="files/images/mcancelshare.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.friendCancelShareCart(\''+item.get('0')+'\')"/></td>'+ '</tr><tr>'+ '<td>Shared</td><td>Edit</td><td>Remove sharing</td>'+ '</tr></table>'+ '<hr class="style3"/>'+ '<table class="tblSlati" style="font-size:14px;">'+ '<tr class="spaceUnder"><td>'+item.get('1')+' '+item.get('2')+' '+item.get('7')+ ' <span dir="ltr">₪ '+ item.get('6')+'</span>'+ '</td></tr></table>'; else return '<span style="display:none;">'+item.get('0')+'</span>'+ '<table class="tblSlati" style="table-layout:fixed;">'+ '<tr class="spaceUnder">'+ '<td><img height="30px" src="files/images/mshare3.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.sharethiscart(\''+item.get('0')+'\')"/></td>'+ '<td><img height="30px" src="files/images/medit2.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.editCart(\''+item.get('0')+'\')"/></td>'+ '<td><img height="30px" src="files/images/mdel1.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.delthiscart(\''+item.get('0')+'\')"/></td>'+ '<td><img height="30px" src="files/images/mlock2.svg"'+ ' style="margin:auto;" onclick="javascript:frmUserMain.grdAllCarts.lockthiscart(\''+item.get('0')+'\')"/></td>'+ '</tr><tr>'+ '<td>Share</td><td>Edit</td><td>Delete</td><td>قفل</td>'+ '</tr></table>'+ '<hr class="style3"/>'+ '<table class="tblSlati" style="font-size:14px;">'+ '<tr class="spaceUnder"><td>'+item.get('1')+' '+item.get('2')+' '+item.get('7')+ ' <span dir="ltr">$ '+ item.get('6')+'</span>'+ '</td></tr></table>'; }, sortProperty: '1' }); Ext.defer(function() {frmUserMain.grdAllCarts.deselectAll();}, 550);
  19. http://forums.unigui.com/index.php?/topic/8954-me-myself-cart-a-new-mobile-app-with-full-source-code/ I have been studying this project from Mohammad. I wanted to emulate how he did his grid with multiple lines and different formatting within. It looks like this is how it is done: config.itemTpl= new Ext.XTemplate( '<table class="lsttbl" border="0" height="40px">'+ '<tr>'+ '<td class="lsttbl_title" style="width:50px;vertical-align:top;">Item:</td>'+ '<td class="lsttbl_info" colspan="4" style="color:#e91e63;vertical-align:top;">{1}</td></tr><tr>'+ '<td class="lsttbl_title" style="width:50px;vertical-align:bottom;">Quantity:</td>'+ '<td class="lsttbl_info" style="width:40px;text-align:center;vertical-align:bottom;">{2}</td>'+ '<td class="lsttbl_title" style="width:50px;vertical-align:bottom;">Price:</td>'+ '<td class="lsttbl_info" style="width:40px;text-align:left;vertical-align:bottom;">{3} $</td>'+ '<td></td>'+ '</tr></table>'+ '<img onclick="javascript:frmUserMain.grdNewCart.deleteItem(\'{0}\')"'+ ' src="files/images/del1.svg" height="24px" style="position:absolute;right:10px;top:18px;"/>' ); This is a real breakthrough to see that I can use tables within a DBRow. It looks to me that {0}...{3} is the data. Is this from TVCLDBColumns[0..4]? I tried something very simple in the Column Resize Demo Project. C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Touch\DBGrid Column Resize function beforeInit(sender, config) { config.itemTpl= new Ext.XTemplate('<p> a {1} b {2} c {3} </p>'); } It still shows the rows normally. Is there something else I need to do to make this work? Thanks for sharing your code.
  20. I tried .x-grid-row-selected { background-color: red; } But nothing happened
  21. In Chrome click the 3 dots to open the menu. Click More Tools->Developer Tools. You can choose a phone to emulate, or desktop and the speed of the connection.
  22. I am sorry my post was very unclear (it was late at night ). I meant TUnimDBGrid. Is there a document you recommend for understanding CSS files? They seem very complicated.
  23. in the sencha-touch css selecting an item in a list changes its color but in cupertino it does not. I have been looking at the css files but I don't know what to do. It looks like it has something to do with: .x-item-selected. but everything I try doesn;t work.
  24. At the beginning of the program, I set font color etc. If I want to change the font color later in the program I call the same function: FClass := ''; if (ctos(FFont.Color) <> 'nil') then FClass := FClass + ' ' + ctos(FFont.Color); FClass := FClass + ' fontsize' + IntToStr(FFont.Size); if (fsBold in FFont.Style) then FClass := FClass + ' bold'; if (fsItalic in FFont.Style) then FClass := FClass + ' italic'; if (FBorderWidth > 0) then FClass := FClass + ' bordercolor' + IntToStr(FBorderWidth) + FBorderColor; FClass := FClass + ' ' + FFont.Name; FClass := TrimLeft(FClass); if (length(FClass) > 0) then begin JSConfig('baseCls', [FClass]); JSConfig('cls', ['_x-field']); end; and I get: --------------------------- Debugger Exception Notification --------------------------- Project SimpleLandlord.exe raised exception class Exception with message 'Config Option: O16A->baseCls:"clRed fontsize8 Tahoma"<br/>is referring a previous request,<br/> it's not allowed in AJAX request or JS handler.<br/>Use equivalent Public Property or Method instead.'. --------------------------- Break Continue Help ---------------------------
×
×
  • Create New...