Jump to content

markus_ja

Members
  • Content Count

    324
  • Joined

  • Last visited

Everything posted by markus_ja

  1. markus_ja

    Calendar Control

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

    Should the Debugger work?

    Hello, I never could make the debugger working. Beginning from v2.1, when it was introduced. Is that feature suppost do work? When I activate debugging (pressing the small green bug button), and then execute the project, ... 1) the programm doesn't stop on the breakpoints 2) when I close the build in browser, the Execute button remains disabled. Thus, I need to restart the IDE in order to enable that button again. Furthermore, using "Source Map" to see the code in the build in browser, the program doesn't stop at the breakpoint, set in the build in browser. It stops at some very strange positions, which doesn't belong to the source map code. That means, I cannot debug my smart pascal code. Only the compiled java script code. Do I miss some settings?
  3. markus_ja

    TMS Web Core

    That‘s true. TMS currently targets desktop browsers.
  4. 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
  5. markus_ja

    Smart 2.9.9 [alpha] is here!

    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 + ???)
  6. markus_ja

    LineBreak

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

    LineBreak

    Is there alread a constant for a line break in the RTL? In Delphi there is sLineBreak and in .Net we have Environment.NewLine. It would be great to have such simple thing also in SMS. I don't want to use #13#10 as hardcoded value.
  8. If somebody is interested. I am currently develping a demo on how I can use SMS with some external UI javascript libraries for business web applications. In that case I used the open source library jQuery UI. The 'content' can be visually constructed in a seperate form. That form is then loaded into the main page. So you can design each content page well organized in one unit (form). For customized theming you can use the jquery ui ThemeRoller. http://jqueryui.com/themeroller/
  9. 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.
  10. markus_ja

    Savetostring issue in TW3Dataset

    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.
  11. 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.
  12. Hello, I just want to share my attempt to implement anchors to the UI, in order to be able to create easier web application. My approche is not perfect and has some workarounds, since it needs some changes in the underlying RTL/SmartCL classes. But it's good starting point. And mybe it can be adapted to the RTL/SmartCL classes. It's build with v2.1.2 LayoutTest.zip
  13. markus_ja

    Listbox Item Fonts

    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.
  14. markus_ja

    How to change the style of a TW3Header text?

    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; }
  15. markus_ja

    How to change the style of a TW3Header text?

    This works fine for me. No changes required. W3HeaderControl1.StyleClass := 'myHeaderText'; .myHeaderText > fieldset > div { color: green; } or .myHeaderText > fieldset > .TW3LabelText { color: green; }
  16. markus_ja

    layering mechanism for nested layouts

    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.
  17. markus_ja

    Styling a Panel with a background image

    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.
  18. Hello, I want to access the camera on iOS. And since iOS6, that is supported by the browser. Using <input type="file" access="image/*" capture="camera"> works fine on my desktop browser, but not on my iPad. The input box is not shown as file input box. I also tried some other pages, and there it works, like here: http://jsfiddle.net/4WHw5/1/ It seems I am missing something. This is my code: edtFileUpload.InputType := itFile; w3_setAttrib(edtFileUpload.Handle, 'accept', 'image/*'); w3_setAttrib(edtFileUpload.Handle, 'capture', 'camera'); Can anybody help?
  19. markus_ja

    input type="file" not working on iOS9 (iPad)

    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);
  20. markus_ja

    CSS Tools with SMS

    What to you mean?
  21. markus_ja

    EncodeDate Rounding issue

    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
  22. markus_ja

    EncodeDate Rounding issue

    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
  23. 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;
  24. markus_ja

    How to work with JSON data?

    Hello, my rest server is returning a JSON string. How can I parse it as JSON Object, in order I can access the values properly? Here is my code snippet: REST[W3EditBox1.Text,''].Call .OnDone( procedure(http: TW3HttpRequest) begin W3Memo1.Text := http.ResponseText; end) .onError( procedure(http: TW3HttpRequest) begin W3Memo1.Text := http.ResponseText; end) .Get;
  25. markus_ja

    PageSpeed ranking

    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?
×