Jump to content

chrisjohn82

Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by chrisjohn82

  1. Hi,
    I have i hybrid application and i'm trying to hide the characters on the login screen where i have a TunimEdit. There is a property called "PasswordChar" that is defaulted to #0. I tried to remove the 0 but did not work. I have the same login screen in the desktop version where i have a TuniEdit, when i set the "PasswordChar" to # it works and hides the chars. 
     
    Best Regards
    Christian

  2. I solved it by using to image controls. If the width of the picture is greater than the max allowed width i change the width to the max allowed with and make the height proportional to the new width and then i save the picture with the new 

    width and height. See code below 

     

    Begin

      J:=TJPEGImage.Create;
          w:=imgtest.Picture.Width;
          h:=imgtest.Picture.Height;
            if w > UniMainModule.picWidth then begin
              p:=round((UniMainModule.picWidth*100)/w);
              w:=UniMainModule.picWidth;
              h:=round((p*h)/100);
           end;
       // set new widht and height in imgtest2 control
          imgtest2.Picture.BITMAP.Width:=w;
          imgtest2.Picture.BITMAP.Height:=h;
          imgtest2.Picture.BITMAP.Canvas.StretchDraw(Rect(0,0,w,h),imgtest.Picture.Graphic);
          J.Assign(imgtest2.Picture.Bitmap);
          J.CompressionQuality:=75;
          J.SaveToFile(destName);
          J.Free;
          imgtest.Picture:=nil;
          fn:=AStream.FileName;
          AStream.Free;
          DeleteFile(fn);
    end;
  3. Hi everybody,

    I want to resize an image if the width is greater than 1000 pix and if it is i want to resize it. I'm using fileupload and loading the file to an imagecontrol and then i'm checking if the width is greater than 1000 pix, so far so good but i can't seem to find a resize function for the imagecontrol? Code below shows want i'm trying to do

     

       imgtest.LoadFromStream(AStream);
       if imgtest.Picture.Width > 1000 then begin
    //    ShowMessage('bigger than 1000');
          
          I want to change the size before i save it to destName
     
          imgtest.Picture.SaveToFile(destName);
       
       end;
  4. Hi everybody,

     

    I have a TunimDBDatePicker that is bound to a date field in a mysql database and i want the control to show blank (no date) when the field is "null" or "00-0000-00" the control is showing 1899-12-30 and i don't want to set the control to any specific date when the form shows, only to show blank. In the webversion the datepicker control will show blank if the field is null in the database but not in for the mobile control. Is there a way to get the mobile datepicker to show blank ? 

     

    Best Regards

    Christian 

  5. I tried in both controls and it did not work on the web control(did not get an error message but the "x" still shows and works) but i can't get it to work on the mobile either because i already have code for the color code and if i try the code below i get an error that says "unexpected identifier 'sender'" and onEnter and onExit i have the following code below. If i remove the code in beforeinit and comment out the code in onExit and onEnter it works but i want both.

     

    Code for the mobile control 

     

    function beforeInit(sender, config)
    {
       config.clearIcon = false
       
       sender.setFieldStyle = function (a){
            var b=this,
            c=Ext.get(b.element.select('.x-input-el').elements[0].id);
            if©{c.applyStyles(a)}b.element.fieldStyle=a
        } 
    }
     
    OnExit for the numbercontrol  (if i comment this code out, i get the clearbutton to disappear)
     
    procedure Tform5.edantalettExit(Sender: TObject);
    begin
       if not edantalett.ReadOnly then begin
           (Sender as TUnimDBNumberEdit).Color := clWhite
       end;
    end;
     
    OnEnter for the numbercontrol  (if i comment this code out, i get the clearbutton to disappear)
     
    procedure Tform5.edantalettEnter(Sender: TObject);
    begin
       if not edantalett.ReadOnly then begin
           (Sender as TUnimDBNumberEdit).Color := clYellow
       end;
    end;
     
  6. Hi,

    I wonder if it's possible to put a pin when showing google maps. I'm reading coordinates from mysql and displaying the map that correspond to the coordinates but i want to put a pin to show exactly where on the map the location is? I looked at the google maps demo but there was no pin in the example. 

     

    Best Regards

    /Christian

  7. Hi, 

    i tired but it did not work, i got an error  [dcc32 Error] E1026 File not found: 'PROGRAM.res'  

     

    i comment the fist line which is //program Effect_WorkOrders; and then i closed and saved, open it up again and recompiled but got an error.

  8. Hi,

    Thank you, numeric works good and it's blocking alphanumeric chars, but i also want to allow decimal for floating points too like "45.5" if that is possible because the field is meant for entering km2. I ONLY want the user to  be able to enter numeric 0 - 9 and period sign. 

     

    Best regards. 

  9. Hi,

    Anybody know how to set an editmask on TunimDBedit, I only want to allow numeric characters. Is there a property for this or can it be done Onchange or OnKeyUp event? I found a code below online but did not work, 

     

    if not (Key in [#8, '0'..'9', DecimalSeparator]) then begin
       ShowMessage('Invalid key: ' + Key); 
       Key := #0;
    end
    else if (Key = DecimalSeparator) and
       (Pos(Key, Edit1.Text) > 0) then begin
       ShowMessage('Invalid Key: twice ' + Key);
       Key := #0;
    end;

     

    /Best regards

    Christian J

×
×
  • Create New...