Jump to content

Search the Community

Showing results for tags 'MainForm'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • uniGUI Public
    • Announcements
    • General
    • Feature Requests
    • Installation
    • Deployment
    • Other Platforms
  • Licensing
    • Licensing
    • Ordering uniGUI
  • Bug Reports
    • Active Reports
    • Closed Reports
    • Old Bug Reports
  • uniGUI Development
    • General Development
    • uniGUI Releases & Roadmaps
    • Utilities
  • Mobile Platform
    • uniGUI Mobile
    • Mobile Browsers
  • Users Area
    • Sample Projects
    • Components and Code Samples
    • Third Party Components
  • Non-English
    • Non-English
  • Miscellaneous
    • Hosting
    • Server Security
    • Jobs

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 9 results

  1. I have this mainform with tons of tabs and controls and labels etc... It was taking about 17 seconds before i saw the page start to display on the screen. It worked fine, but the users were clicking refresh because they didn't think it was loading. They were impatient. So, i added a splash screen that displays almost immediately, but still about 17 seconds until the mainform displays. I tracked it down to the uniGUIApplication.pas JSPreProcess function. It consists of removing the /* and */ comments and then it removes the #3 and #4 characters. The first task was taking about 4 seconds and the second task was taking about 13 seconds. You can see that i modified the 1st task so that it takes less than a second instead of 4 seconds. function TUniGUISession.JSPreProcess(const JSCode: string): string; var I,J : Integer; // the following variables are added by DLR PCharS:PChar; PCharD:PChar; Delta:Integer; DeltaTmp:Integer; OrigLen:Integer; ResultAddr:PChar; LastByte:PChar; begin // DLR FASTER COMMENT REMOVAL Result := JSCode; ResultAddr:=@Result[1]; OrigLen:=Length(Result); LastByte:=PChar(Integer(@ResultAddr^)+OrigLen*SizeOf(Char)); Delta:=0; I := pos('/*', Result); while I <> 0 do begin // Extracts comments J := PosEx('*/', Result, I); if J>I then Begin //DLE PCharS:=ResultAddr; Inc(PCharS,I + (J - I + 2)-1); PCharD:=ResultAddr; Inc(PCharD,I-1); DeltaTmp:=((J+1) - (I) + 1); Delta:=Delta + DeltaTmp; // the move could be a little more efficient by not MOVING all the data, but it works fast Move(PCharS^,PCharD^,Integer(@LastByte^)-Integer(@PCharS^)); End else Inc(I, 2); I := PosEx('/*', Result, I); If I>OrigLen-Delta Then I:=0; end; //DLR SetLength(Result,OrigLen-Delta); Result := HandleJSReturns(Result); Result := AnsiReplaceStr(AnsiReplaceStr(Result, CommandDelim, ''), IdentDelim, ''); // Extracts aux delimiters end; You can see i use the MOVE instead of the DELETE operation. SO much more faster. THEN the 2nd task was calling the "AnsiReplaceStr" function which is terribly SLOW and was taking about 13 seconds So, I replaced that function with a replacement i found on the internet. So, i added this code BEFORE the "AnsiReplaceStr" usage. function AnsiReplaceStr(const AText, AFromText, AToText: string): string; begin //DLR Result:= StrUtilsEx.FastStringReplace(AText, AFromText, AToText, [rfReplaceAll]); // Result:= SysUtils.StringReplace(AText, AFromText, AToText, [rfReplaceAll]); end; Function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string; Begin //DLR Result:= StrUtilsEx.FastStringReplace(S, OldPattern, NewPattern, [rfReplaceAll]); //Result:= SysUtils.StringReplace(S, OldPattern, NewPattern, [rfReplaceAll]); End; Of course you will have to include StrUtilsEx in your USES clause. You can see that my replacement functions call a different function in the StrUtilsEX.PAS module. It's much faster. Probably 15 times faster. So, now the 2nd task takes less than 1 second instead of the 13 seconds. The end result is that my splash screen is only displayed for about 4 seconds instead of 17. Great improvement. Keep in mind that this fix is EXTREMELY useful only for LARGE FORMS with tons of controls. You won't notice any difference on small forms. Now for the magic, I have attached the StrUtilsEX.PAS file for your pleasure. Have fun with faster loading forms. If UNIGUI would implement my changes or similar that would be great, OTHERWISE I/we have to update the UniGUIApplication.pas file each time we download a new version Davie StrUtilsEx.pas
  2. function window.afterrender(sender, eOpts) { var PhysicalWidth = screen.width; var PhysicalHeight = screen.height; var ScreenWidth = screen.availWidth; var ScreenHeight = screen.availHeight; var BrowserWidth = Ext.getBody().getViewSize().width; var BrowserHeight = Ext.getBody().getViewSize().height; var BrwsrInnerWth = window.innerWidth; var BrwsrInnerHgt = window.innerHeight; var r = window.orientation; ajaxRequest(MainForm.window, '_Rendered_', ["r="+r, "ScreenWidth="+ScreenWidth, "ScreenHeight="+ScreenHeight, "PhysicalWidth="+PhysicalWidth, "PhysicalHeight="+PhysicalHeight, "BrowserWidth="+BrowserWidth, "BrowserHeight="+BrowserHeight, "BrwsrInnerWth="+BrwsrInnerWth, "BrwsrInnerHgt="+BrwsrInnerHgt ]); } // ONLY FIRES bclose, cinfo, afterrender(not my one), resize procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin ////////////////////////////////////////////////////////////////////////////// if SameText('_Rendered_', EventName) then begin // NEVER FIRES Please advise - Thanks in advance
  3. Good afternoon! I will put my question in a separate topic, because I have almost solved it, but not completely, and I ask you to tell me why such an error occurs. So, the task: to transfer from the dynamically created UniFrame1 to the main HModule program of the DLL package, which needs to be unloaded after closing the dynamically created UniTabSheet (parent for UniFrame1). To date, this is what has been done. In MainForm, I'm creating dynamically UniTabSheet1: ... UniTabSheet1:=TUniTabSheet.Create(UniPageControl1); UniTabSheet1.PageControl:=UniPageControl1; UniTabSheet1.Parent:=UniPageControl1; UniTabSheet1.Name:='UniTabSheet1_Test'; UniTabSheet1.Caption:='blabla'; UniTabSheet1.Visible:=True; UniTabSheet1.Closable:=True; UniTabSheet1.OnClose:=UniTabSheet_Close; ... Also, after, I'm creating dynamically UniFrame1: UniFrame1:=TUniFrame1.Create(self); UniFrame1.Align:=alClient; UniFrame1.Parent:=UniTabSheet1; UniFrame1.Name:='TUniFrame1_Test'; if UniFrame1 <> nil then begin //here, i'm transfer HModule of BPL from MainForm in my UniFrame1: if IsPublishedProp(UniFrame1,'GV_Test') then SetPropValue(UniFrame1,'GV_Test',MyHModuleValue); end; By the way, in MainForm I have it written like this: ... private procedure SetGlobalValue_Test(const Value: HModule); public TransferedBPL,GettingBPL: HMoudle; published property GV_Test: HModule read TransferedBPL write SetGlobalValue_Test; ... //getting HModule from UniFrame1 in MainForm: procedure TMainForm.SetGlobalValue_Test(const Value: HMODULE); begin GettingBPL:=Value; end; //unload BPL by getting HModule: procedure TMainForm.UnloadAfterCloseUniTabSheet; begin SetGlobalValue_Test(GettingBPL); UnloadPackage(GettingBPL); end; //when closing UniTabSheet1: procedure TMainForm.UniTabSheet_Close(Sender: TObject; var AllowClose: Boolean); begin UnloadAfterCloseUniTabSheet; end; In UniFrame 1, I get my HModule like this: ... private procedure SetGlobalValue_Test2(const Value: HModule); public TransferedBPL: HMoudle; published property GV_Test2: HModule read TransferedBPL write SetGlobalValue_Test2; ... procedure TUniFrame1.SetGlobalValue_Test2(const Value: HMODULE); begin GV_Test2:=Value; end; In UniFrame1: procedure TUniFrame1.UniLabel1Click(Sender: TObject); begin if TransferedBPL <> 0 then begin if IsPublishedProp((Parent as TUniTabSheet),'GV_Test2') then SetPropValue((Parent as TUniTabSheet),'GV_Test2',TransferedBPL); end; end; (Parent as TUniTabSheet).Close; end; But, where I'm appling all this code, I'm getting error: Please, help me... I found out for sure that all the code above works up to the point that my HModule is passed from MainForm to UniFrame1, I know for sure that it works. I can't pass this HModule back to MainForm.
  4. I have a function in javascript where I wanted to trigger the return of it to mainmForm, but I'm not getting it, how to do it? I'm trying that way function hashPagSeguro() { PagSeguroDirectPayment.onSenderHashReady(function (response) { if (response.status == 'error') { console.log(response.message); return false; } var hash = response.senderHash; ajaxRequest(MainmForm,'senderHash', ['hash='+hash]); console.log(hash); }); } but I am having this error
  5. Hello If I add a new form to the application, and drop a unimap component and run it, an error occurs. But if I put the unimap component in the mainform everything works fine. My question is: Does the UniMAP component only work in the mainform? Thank you very much in advance
  6. How does the UniGUI core recognize who exactly is the MainForm class ? My MainForm is TUniForm like other in project. I did not able to find the property in TUniGUIMainModule or TUniGUIServerModule for this or I miss something ?
  7. Hi, I put one 'login' button in the right top corner of the main form. Main Form Properties setting: 1) BorderStyle = bsNone 2) WindowState = wsMaximized My problem is : 1) I resize the browser to half size, I cannot see the scroll bar. 2) If I open the application with half size of the browser, then maximize the browser . The main form will not extend with browser. If I change the WindowState to wsNormal, then the main form will be 'cut off' when I resize the browser windowns. I would like to know is there any simple demo that can create the similar main form in the AllFeaturesDemo? Thank You.
  8. Estou usando WindowState como wsMaximized e testei com todos os tipos de bordas, mas o form principal não cobre toda a área do browser (testei com Chrome e Firefox), deixando um espaço livre à direita. Vejam a imagem em anexo. Alguém já teve este problema e conseguiu resolver ?
×
×
  • Create New...