Jump to content

markus_ja

Members
  • Content Count

    324
  • Joined

  • Last visited

Everything posted by markus_ja

  1. When using 3rd party controls, how is styling done in order it has the same style as the other controles?
  2. markus_ja

    TMS Web Core

    That‘s true. TMS currently targets desktop browsers.
  3. markus_ja

    TMS Web Core

    The have already a full working designer and a lot of controls. As they stated, you can use all FNC components: Grid Ribbon Planner RichEditor TreeView PDF Lib PageControl & panels Edit List Pickers & selectors Miscellaneous
  4. How would the code look like, if you want to put a second control under the first control, considering padding and margin)? secondControl.SetTop(firstControl.ClientHeight + ???)
  5. markus_ja

    LineBreak

    Yes. It's already included in SmartCL.System. At least in v2.2.1
  6. markus_ja

    Help with app

    I encountered troubles with the LayoutManager if it dependce on other elements, too. In my case I had to create a new Layout instance on every resize call. Try to place the FLayout := into the overridden Resize method. It seems that the LayoutManager caches some size properties from child contols for better performance, but didn't think of other use cases.
  7. The issue is in the following code in the unit: System.DataSet Function TW3Dataset.SaveToString:String; var mHead: TW3DatasetHeader; Begin if FActive then Begin try (* Setup the header *) mHead.dhMagic:=$CAFE; mHead.dhCount:=getRecCount; (* Serialize and store field-defs *) mHead.dhFieldDefs:=EncodeURI(FDefs.SaveToString); (* Serialize and store dataset records *) asm (@mHead).dhData = JSON.stringify((@self).FCache); end; (* Now serialize and return text representation of data structure *) asm @result = JSON.stringify(@mHead); end; except on e: exception do raise EW3Dataset.CreateFmt(CNT_ERR_DATASET_FailedStore,[e.message]); end; end; end; Replace asm (@mHead).dhData = JSON.stringify((@self).FCache); end; with asm (@mHead).dhData = JSON.stringify(@FCache); end; And it will work! Reason: (@self).FCache becomes in javascript (self).FCache$1.
  8. markus_ja

    LocalStorage

    The issue is, that form activate and deactivate are not invoked by the framework. You have to call activate or deactivate by your self.
  9. Hi ielite, if you look at the components source code, it's obviously that your code (style) is not working. You have to define your custom style classes in the TW3ListBox, and not on the Item itself, e.g.: lbxMenu.Styles.Item := 'lbItem'; lbxMenu.Styles.Highlighted := 'lbItem'; lbxMenu.Styles.Selected := 'lbItem'; The TW3ListBox.HandleMouseEnter event overrides the item style using its defined styles. procedure TW3ListBox.ColorItem(item: TW3CustomControl; itemStyle: String; itemColor: TColor; colorVisible: boolean); begin if colorVisible then begin item.StyleClass := itemStyle; //<- style applied!!! item.Color := itemColor; end; end; My advise: If you have troubles with styles, use the build in chrome debugger (F12) and have a look at the html code (elements tab), and watch wich styles are applied and when.
  10. I didn't try right now, but you can declare as many css class styles you need. in your case, this should work: .pnlHeader > fieldset > .TW3LabelText { color: green; } .pnlHeader > button { color: red; }
  11. This works fine for me. No changes required. W3HeaderControl1.StyleClass := 'myHeaderText'; .myHeaderText > fieldset > div { color: green; } or .myHeaderText > fieldset > .TW3LabelText { color: green; }
  12. This is an unmonitored User Forum. So your Suggestion will not be Seen by the proper People. since there ist so less activity, i Hope that Project is not dead.
  13. use background: url('nav_bg_leaves.gif') no-repeat 0 100%; instead of background-image. This is an invalid property. Also delete res/ . It seems, that res/ is automatically added.
  14. You don't have to use the TW3EditBox. You have to use "clean" <input> tag, without all the default attributs. I created a simple wrapper: TMyInputFile = class(TW3CustomControl) private procedure SetAccept(aValue: string); procedure SetCapture(aValue: string); protected function MakeElementTagObj: THandle; override; procedure StyleTagObject; override; public procedure OpenDialog; property Accept: string write SetAccept; property Capture: string write SetCapture; end; { TMyInputFile } procedure TMyInputFile.StyleTagObject; begin //prevent default w3_setAttrib(Handle, 'type', 'file'); end; function TMyInputFile.MakeElementTagObj: THandle; begin result := w3_createHtmlElement('input'); end; procedure TMyInputFile.SetCapture(aValue: String); begin w3_setAttrib(Handle, 'capture', aValue); end; procedure TMyInputFile.SetAccept(aValue: String); begin w3_setAttrib(Handle, 'accept', aValue); end; procedure TMyInputFile.OpenDialog; begin Handle.click(); end; Usage: //Image File Upload _myFileOpenDialog := TMyInputFile.Create(divViewGeneral); _myFileOpenDialog.Visible := false; _myFileOpenDialog.Accept := 'image/*'; // or '.png, .jpg' _myFileOpenDialog.Capture := 'camera'; _myFileOpenDialog.Handle.addEventListener('change', procedure(e: Variant) var fileReader: JFileReader; fileList: JFileList; begin fileList := JFileList(e.target.files); if fileList.length > 0 then _imageFile := fileList.item(0) else _imageFile := nil; if Assigned(_imageFile) then begin fileReader := JFileReader.Create; fileReader.onload := function(event: JEvent): Variant begin imgRecipe.Url := Variant(event.target).result; result := true; end; fileReader.readAsDataURL(_imageFile); end; end, false);
  15. Thanks! Interessting. But the issue I encountered is actually in the DWS function StrToDate(), which I am using. I just saw that this function is using EncodeDate, and tried to isolate the issue. Is there also a trick
  16. Hello, Encoding a date returns wrong value (=rounding issue). procedure Test; var d, d2: TDate; isE: Boolean; begin d := Date; d2 := EncodeDate(YearOf(d),MonthOf(d),DAyOf(d)); isE := d=d2; WriteLn(Format('Equal: %s, d: %d, d2: %d', [isE.ToString,d,d2])); end; Result: Equal: False, d: 42557, d2: 42556.91666666667 [line #352] https://bitbucket.org/egrange/dwscript/issues/65/encodedate-rounding-issue
  17. I had problems with caching on iOS in the web browser. If you have a lot of pictures (eg. thumbnails), some pictures are not shown, because of caching limitiations on iOS. In my case, I had to put a random number on every image url to get not cached. With that approche all pictures are shown. Unfortunately, when you add your web page to the iOS Desktop, loading images doesn't work anymore. I can only show about 5 - 7 thumbnails So far I found out in the net is, that apple wants to prohibit web apps on iOS. You should distribute all apps through the online store (where they get money). Does anybody have experience with converted web apps to real apps with cordoba (phone gap)? Is there caching also an issue?
  18. I added the following line, and now it works as expected: procedure TApplicationFormsList.AutoCreateForm(aFormInfo: TApplicationFormInfo); begin if not Assigned(aFormInfo.Instance) and aFormInfo.IsAutoCreated //markus_ja - Added then begin aFormInfo.Instance := aFormInfo.FormClass.Create(FFormOwner); Application.RegisterFormInstance(aFormInfo.Instance, aFormInfo.IsMainForm); end; aFormInfo.InitialAutoCreateDone := true; end; There was no IsAutoCreated check. I hope this will be fixed in the next hotfix!
  19. Added: Data.Provider.mORMot now you can use it with mORMot build in user authentication. The Rest server is build on the TSQLRestServerFullMemory class. In contrast to the default Data.Provider.REST unit, there is no user authentication implemented. Thanks to mORMot CrossPlatform units.
  20. Hello, I have a unit, which has a class with a proteced function, which I want to access. Is that possible in SMS? In Delphi, I just create a Accessor Class in my unit and then I can access it. But doing it in SMS, the type cast raises an exception. unit A TAClass = class protected function Foo; end; unit B TAClassAccessor = class(TAClass) end; var x: TAClass; begin x := TAClass.Create; TAClassAccessor(x).Foo; //raise type cast exception end;
  21. I attached it again. Please try again. DataProviderSample.zip If it is not working, do you have a place where I can upload it?
  22. @warleyalex I attached a sample project, to show how my data.provider can be used. You can have a look if it is suitable for you. Hirachy: - general: IDataProvider -> TDataSource -> TMyDataModel -> (work with the data) DataProvider: Contains all data (as REST Server or local/in-memory data) DataSource: Implements the data table/query you want have. It's the bridge between DataProvider and DataModel DataModel: Holds only the data which are retrieved from the DataSource in a type safe way. - concret: TTestDataProvider -> TDepartmentDataSource -> TDepartmentModel TTestDataProvider -> TEmployeeDataSource -> TEmployeeModel
  23. Hi Alex, I created a little generic data provider framework to switch easily from prototyping in memory data to a rest data, or any provider you implement. In that framework I use the TW3DataSet as data transfer object. If you are interested I can share the source code? With my TFilterExpressionTree class, I also have a generic class to filter the data. http://forums.smartmobilestudio.com/index.php?/topic/3977-generic-filterexpression-class-show-case/ In my Data.Provider unit I have the following declaration: //Is responsible to retrieve the data from a datastore IDataProvider = interface; TDataSetDataProvider = class(IDataProvider) TRESTDataProvider = class(IDataProvider) //Is the base class for a concret data model TDataSource = class; //Concret data model implementation unit Data.Source TOnDoneUserModel = procedure(aModel: TUserModel); TUserDataSource = class(TDataSource) private const URI = 'user'; public procedure Read(aUserName, aPassword: string; aOnDone: TOnDoneUserModel); end; and at the project start, just set the data storege where you want to retrieve your data: //DataProvider: IDataProvider := TTestDataProvider.Create(TTestData.Create); DataProvider: IDataProvider := TRESTDataProvider.Create('http://10.0.0.4:888/api_v1'); So you can start with prototyping data, and later you can create you REST service. I use it already in my project.
  24. @Cipher Diaz: When will the new RTL ready, what will be different? I am just curious
×
×
  • Create New...