Jump to content

mhmda

uniGUI Subscriber
  • Posts

    1141
  • Joined

  • Last visited

  • Days Won

    157

Posts posted by mhmda

  1. Hello,

     

    Let us say that I want to create my OWN button which inherent from 'TUnimButton', and I want to add several config properties to it: iconCls,style and flex I would do:

    Type
      TmMYButton = class(TUnimButton)
      private
        Fstyle: string;
        FiconCls: Ticons;
        Fflex: integer;
        procedure Setstyle(const Value: string);
        procedure SeticonCls(const Value: Ticons);
        procedure Setflex(const Value: integer);
      protected
        procedure ConfigJSClasses(ALoading: Boolean); override;
        procedure LoadCompleted; override;
      public
        constructor Create(AOwner:TComponent); override;
      published
      property style:string read Fstyle write Setstyle;
      property iconCls:Ticons read FiconCls write SeticonCls;
      property flex:integer read Fflex write Setflex;
    end;
    

    And in loadcomplete I use this code, to add my properties to the mybutton config:

    type THackControl=class(TUniControl);
    procedure TmMYButton.LoadCompleted;
    var
     icn:string;
    begin
      inherited;
    if FiconCls<>iNon then
     icn:= GetEnumName(TypeInfo(Ticons),integer(FiconCls))
    else
     JSConfig('style',''''+style+'''');
     JSConfig('iconCls',''''+icn+'''');
     if flex>0 then JSConfig('flex',inttostr(flex));
    end;
    

    My proplem is: The base class for my button is 'TUnimButton' and it has other config properties like: width,height.... I want to remove for example the 'width' property from base class 'TUnimButton' so when the config sent to brwoser it will NOT contain the 'width' property, how can I do that?

     

    This is a unitouch code sent to browser:

    O2F=new Ext.Button({id:"O2F_id",text:"UnimButton1",width:225,height:47,left:48,top:144});
    

    It is not only about specific property it is all about making the development more easy for us and less depended on unitouch component future updates, So we feel that we are sometimes tied with these properties that we don't want or we want to change and we don't have the ability to change them (not for my own need, but for the logical behavior of such component in real production app), so our solution is to create inherent component and add any property or any thing we want. BUT how can I 'remove' property from config which declared in parent class?

     

    Any suggestion would be great!

     

    Thank you,

    • Upvote 1
  2. Hi,

     

    I have tried almost every combination but without success, how can I use 'ajaxRequest' I need the first param?

     

    Is this technique implemented in unitouch?

     

    In extjs I would use:

    ajaxRequest(MainForm.window, 'test1', [] ); 

     In unitouch what is equal to 'MainForm.window'?

  3. Hello,

     

    I want to share some thoughts with you as a developer who worked with unitouch for last month every day all day...

     

    um3.png

     

    At the last month we started to support mobile devices in our web application  (Accounting system), and found it sometimes difficult to implement some actions without using a direct sencha touch js code or in some cases we had to build our customize components based on unitouch components, I want to say that we are very happy to work with unitouch inside delphi, but really we want unitouch to answer a based requests in our daily work as programmers.

     

    I know that unitouch in a development process and Farshad releases a new updates almost every day or two, but I think there is minor properties in sencha components that is very very essential to us as developers, like:

     

    [MobileForm] not stable

    - Control the 'close' button on the toolbar at design time to change: Text, UI style (for example: back button).

    - Many times there is a difference between design and runtime views, I mean that the 'Aligment' property of a component doesn't work as expected, for a example I put a list with Aligmnet=alClient at design time displays good but at run time the width and height are fixed as dimension in design time, I tried many solutions: delete and put the list again, check the anchor properties, but nothing the ONLY solution that worked is remove the form and create a new one! just after that the list or scrollbox alClient worked, I really don't know why? I think there is an issue with the "Aligmnet" property for all components (mobile), this issue is very painful for me to recreate forms.

    - When form is a Scrollable I expect the Top ToolBar to remain at the top or any other toolbars like a bottom tool bar with action buttons (save,delete...) also to remain at the bottom,I know that I could solve that with scrollbox, but it is more elegant to scroll form without the toolbars.

    - Animation when moving from Form to another, We have achieved this using a js code, but for the end user animation is important.

     

    [unimList] it is very important component in mobile environment:

    - groupFn property, in order to customize how to group my data.

    - style  property, to enable RTL functionality, and other CSS styles.

    - DataSource, to be a database aware (all fileds, to customize groupFn).

    - itemTpl, to control the way of displaying rows inside the list.

     

    [unimButton]

    - style  property, to enable RTL functionality, and other CSS styles.

    - iconCls property, to choose a default icon or customize icon.

     

    [unimEdit]

    - style  property, to enable RTL functionality, and other CSS styles.

    - clearIcon property, disable/enable clear icon.

     

    Finally those were the important things that I found it difficult to achieve without writing extra code or components, I think Farshad doing amazing work :)  but I ask him to give these requests a high ppriority. and I think to add a property to component is not so hard and don't take a lot of time, will I must say: a minor change for Farshad a big change for us !

     

    Thank you,

     

    um1.png

     

     

     

    um2.png

     

     

     

     

     

    • Upvote 2
  4. Why do you want to do something like that ?? you can't "unset" property, even if there is no with the browser will use its' default value for width.

     

    **** Our main Problem as developers is: ****

     

    We all (or most of us) came from windows programming background and we expect web programming same as windows and here we get ourselves into problems that we can't solve, so I suggest you (myself first) to refer to basic web programming (client/server), html (post,get,update,delte...), css styling, js and so on.

    unigui can't resolve any problem that related to understanding how web app is working and we try to do something without even knowing the consequences of this.

     

     

    Anyway this is a CSS property and when changing width/height... you can override extjs main class, or just create a new class and set any thing you want, for example if you want to change a label/container/panel... width you may use this code:

     

    1. At servermodule-->customcss:

    .mylabel
    {
     width: 100px !important;//you have to use the !important otherwise it wont work
     width: 50% !important;//other way to use width
    }
    

    2. in label or any component-->extevents-->added (event):

    function added(sender, container, pos, eOpts)
    {
      sender.addCls('mylabel');
    }
    
    • Upvote 1
  5. hi,

     

    You can also use FortiClient (software) from fortinet compny: http://www.forticlient.com/

     

    If you want more security you may use: FortiGate (hardware) from fortinet, I have one.

     

    - FortiGate gives you the ability to use both SSLVPN and VPN for maximum security.

    - You can migrate it to use server active directory.

    - You can use the Client  to Site (c2s) feature. 

    - You can use the Site to Site (s2s) feature. 

     

    Also you may use Checkpoint hardware: safe@office or massive one "blade".

     

    Also you may use cisco ASA (cisco really good with routers and switchs but with security I don't think so :-() 

     

    Remember the forti/checkpoint hardware are expensive but it gives you the maximum security.

  6. hi,

     

    1. in servmodule->customcss add:

    .body_grdnt
    {
     background: #ffffff; /* Old browsers */
     background: -moz-linear-gradient(top,  #ffffff 0%, #d1cccc 100%); /* FF3.6+ */
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#d1cccc)); /* Chrome,Safari4+ */
     background: -webkit-linear-gradient(top,  #ffffff 0%,#d1cccc 100%); /* Chrome10+,Safari5.1+ */
     background: -o-linear-gradient(top,  #ffffff 0%,#d1cccc 100%); /* Opera 11.10+ */
     background: -ms-linear-gradient(top,  #ffffff 0%,#d1cccc 100%); /* IE10+ */
     background: linear-gradient(to bottom,  #ffffff 0%,#d1cccc 100%); /* W3C */
     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#d1cccc',GradientType=0 ); /* IE6-9 */
    }
    

    2. Panel-->Extclient events-->added:

    sender.Addcls('body_grdnt');
    

    3. Alternative way is to add label with align="alClient" and add the code to the label->extevents->added.

    • Upvote 1
  7. Here in palastine the price depending on parameters that you mentioned but it's something like 50$-70$/hour.

    So you have to estimate how much will took you to accomplish all missions related to project and after that it will be much easier to give a quote to your client.

     

    Here how we do it (be a proffessional):

     

    1. Get as much as possible details for the project from your client (every thing).

    2. Don't rush and be patient: means your are a programmer and know all aspects of development issues when client ask for 'X' don't say I'll do for you 'X' and 'Y' and...keep something for future updates.

    ​3. Write a professional quote: with your logo at top of the page and your tel,cel,address at the buttom, convert the file to .pdf, don't send it as .doc or docx.

    4. Get him involved: use "balsamiq mockup", or photoshop (which I prefer) to  draw the windows of all the project, and attach these images to your qoute.

    ​5. In your quote you mention these:

        - SLA for beta release (always give yourself a time window for unexpected issues).

        - Warranty and bug fixing (for limited time: 1,2...months)

        - The price.

     

    This how we do it, others may have different ideas. 

  8. 1. Although Extjs is a web framework it's not intended to be run at smartphone/taplets, because of the user experience will be difficult interacting with your app, so if you insist to use it here a technique how you can improve it.

     

    2. I have used this technique before for displaying adds based on js animation because smartphones in general doesn't support flash, so we have html and js as a good alternative, but the problem is: smartphones and tablets has a variant screen size and variant resolution (as your issue) so we had to build a custom add animation for every device (sounds silly)  we didn't, we just wrapped our add main container with a div and we did a zoom (scale) using css and I have to say it was a very good solution for us (and for you).

     

    3. In few words scale your form dynamically as user's screen or display resolution, how? use js 'resize' function+jquery:

    $(window).resize(function() {
       var a=$('#tbllogo').width();//screen width  
       a/=980;//aspect ration   
       if(a>1) a=1;//optionally- if you don't want to make you window bigger than original size
       $(".div_add_max").css("-webkit-transform","scale("+a.toString()+")");//use $(youform.id)
    });
    

    4. You may see it online for website in this link: http://adan.co.il/pindex.php Try to resize your browser window and see how the content changes depending on window size.

     

    5. here a screenshot :

     

    zm1.png

     

     

     

    zm2.png

     

     

    I hope this will help you

  9. 1. Thank you...

     

    2. Next time please make your code look more efficient (use code wrapper) '<>': see result

    function OnAfterrender(sender)
    {
      $("#"+sender.id+"-inputEl")  
        .mask("(99) 99999-999?9")  
        .live('focusout', function (event) {  
          var target, phone, element;  
            target = (event.currentTarget) ? event.currentTarget : event.srcElement;  
            phone = target.value.replace(/\D/g, '');  
            element = $(target);  
            element.unmask();  
            if(phone.length > 10) {  
              element.mask("(99) 99999-999?9");  
            } else {  
              element.mask("(99) 9999-9999?9");  
            }  
        }); 
    } 

    3. We all welcome you in our community  :)

  10. Yes you can:

     

    1. create a custom css class (at srevermodule-->customcss):

     

    * here I use a small pattern image and repeat it all over.

    .grid
    {
    background:url('files/images/grid.jpg') repeat fixed;
    }
    

    2. Add a label on the desired page (0,1,2...)

       - set align=alClient

       - Extevents-->added:

    function added(sender, container, pos, eOpts)
    {
     sender.addCls('grid');
    }
    

    3. Run it....

     

    css.png

     

    Hope this help you  :)

    • Upvote 2
×
×
  • Create New...