Jump to content


uniGUI Subscriber
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by tappatappa

  1. I'd use Sleep() for debugging purposes only. You should test whether it hangs the whole server or not (call a long Sleep and open a new connection on a separate window).
  2. I tried do put <img src='path/to/img.png'/> before each element, and only got partial results: the elements in the list got the correct images but the selected one appears with the html text
  3. wow, what a beautiful bell curve we got!
  4. I got O553.setEmptyText is not a function the other approarch you suggest seems to work, thanks! Edit: here is the code that I am using right now if(!_empty_txt_set) { UniSession()->AddJS(UnicodeString().sprintf(L"%s.view.emptyText='<div class=\"x-grid-empty\">NO RESULT</div>';%s.getView().refresh();", grid->JSName, grid->JSName); _empty_txt_set = true; } so it uses the same div class as a EmptyText. I had to use a boolean because the Server side uniDBGrid still has an empty EmptyText.
  5. Hi, I am trying to set a DBGrid EmptyText at run time, if(MainDBGrid->EmptyText.IsEmpty()) { MainDBGrid->EmptyText = "NO RECORD"; } MainQuery->Open(); but I get this Ajax error message O553.applyEmptyText is not a function I also tried to inject javascript directly, but the result is the same UniSession->AddJS(UnicodeString().sprintf(L"%s.emptyText = '%s'; %s.applyEmptyText();", MainDBGrid->JSName, UnicodeString(L"NO RECORD"), MainDBGrid->JSName);
  6. See the test case attached. TestUniImage.zip
  7. Let me clarify: The line ImgList->GetPng(img_cache.index, p); Is only a cut and paste error. It wass supposed to be ImgList->GetPng(0, p);
  8. it seems exactly what I tried, only in Delphi
  9. I started coding with Embarcadero RAD Studio when I was about 25 years old. I am now 30. But I rarely code in Delphi, I am more a C++ Builder guy. Does it count?
  10. Hi Delphi Developer, Thanks for the link. I tried this TPngImage* p = new TPngImage(); try { ImgList->GetPng(img_cache.index, p); p->Transparent = true; img->Picture->Graphic->Assign(p); } __finally { delete p; } And it kinda works. The only problem is that the pictures lose transparency, they get a black background. P.S. All the images I use are png
  11. Is it possible to "copy" an Image loaded in a TUniNativeImageList into a TUniImage? I tried several approaches, with no luck. img->Picture->Graphic->LoadFromStream(ImgList->Images[0]->MemoryImage); //ACCESS VIOLATION Or TMemoryStream* s = new TMemoryStream(); TNativeImageRecord* img_rec = ImgList->Images[0]; img_rec->MemoryImage->SaveToStream(s); //ACCESS VIOLATION s->Position = 0; img->Picture->Graphic->LoadFromStream(s); Or TMemoryStream* s = new TMemoryStream(); TNativeImageRecord* img_rec = ImgList->Images[0]; img_rec->Graphic->SaveToStream(s); //ACCESS VIOLATION s->Position = 0; img->Picture->Graphic->LoadFromStream(s); Any help?
  12. //Delphi UniSession.AddJS(unicanvas.JSName + '._cc_.fillText("'+text+'",'+left+','+top+');'); //C++ UnicodeString s = UnicodeString().sprintf(L"%s._cc_.fillText('%s',%d,%d);", unicanvas->JSName, text, left, top); UniSession()->AddJS(s); Of course, is better if you do some escaping of the text first, otherwise you will be open to injection
  13. in the main cpp file (the one with the name of the project) #include <UniGUIVars.hpp>//<---------THIS #include <vcl.h> USEFORM("MainModule.cpp", UniMainModule); /* TUniGUIMainModule: File Type */ USEFORM("ServerModule.cpp", UniServerModule); /* TUniGUIServerModule: File Type */ USEFORM("Main.cpp", MainForm); /* TUniForm: File Type */ //--------------------------------------------------------------------------- #pragma link "UniGUIVars.obj" //<---------THIS #pragma TestProject //--------------------------------------------------------------------------- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
  14. Glyph doesn't work with PNG with Alpha Channel (transparency)
  15. It does work with TUniBitBtn, I use them a lot in my project. Do you need SpeedButton specifically?
  16. ok I figured it out, at first I thought you posted a piece of Delphi code. <a href="#" onclick="javascript:ajaxRequest(MainForm.window,'openClick');MainForm.window.showMask('wait');"style="text-decoration: none"> thanks
  17. try TUniNativeImageList
  18. Hi mohammad, let me give you a bit of context: I have a TUniDBText (TextConversion = txtHTML) with the underlying query something like select '<table>' ||'<tr>' ||'<td colspan="2"><a href="#" onclick="javascript:ajaxRequest(MainForm.window,''openClick'');"style="text-decoration: none">' ||'<div class="mydivclass">DETAILS</div>' ||'</a></td>' ||'</tr>' ||'</table>' a_html from mytable where a_id=1 of course I am handling the event... void __fastcall TFormMain::UniFormAjaxEvent(TComponent *Sender, UnicodeString EventName, TUniStrings *Params) { if (EventName.Compare(L"openClick") == 0) { doSomething(); } } But since the "click" event might take a while to process I need a way to tell the HTML/javascript side to show a mask covering the HTML table (or the form).
  19. Any idea on how to add a screenmask?
  20. Database components are not included. What is Delphi without Oracle?
  21. 1) Consider putting the css in ServerModule->CustomCSS. 2) Have you set HTMLFrame::Align = alClient?
  22. +1 As soon as I started using FieldLabel I noticed this inconsistency between design and runtime. This is pretty evident if set FieldAlign = alTop: nothing changes at design time, while at run time the Edit is moved several pixels down.
  23. In order to make it work you need to separate two steps: 1) the Ext.override code and the beforeInit ....let the JS component render 2) UniSession->AddJS(...) This is necessary because if you fire both at the same time (for instance at form first Show) the JS code can't find the ExtJS DatePicker. In practice, try to execute TMainForm.HighlightDatesPush(ADt: TDate; ATitle: string) after a Timer fires (once) or on button click
  24. Found a solution: 1) Put this early in the application (for instance at the construction/show of the main form) Ext.override(Ext.DatePicker, { highlightDates:[], enablePickerHighlight:false, isAnotherMonthView: function(date) { var activeDate = this.activeDate || date; return date.getYear() != activeDate.getYear() || date.getMonth() != activeDate.getMonth(); }, update: function(date, forceRefresh) { var me = this; monthViewChange = me.isAnotherMonthView(date); this.callParent(arguments); if(me.enablePickerHighlight){ me.highlightDates.forEach(function(dates) { me.cells.each(function(el) { if (Ext.Date.clearTime(dates.dt, true).valueOf() == el.dom.firstChild.dateValue) { if (el.hasCls(me.activeCls)) { el.addCls('x-datepicker-highlight'); } else { el.addCls('x-datepicker-highlight-prevnext'); } //enable this if you wish custom title /*el.dom.title = dates.title;*/ return false; }; }); }); if (monthViewChange) { Ext.defer(function() { me.fireEvent('select'); }, 200); } } } }); 2) in the particular picker, beforeInit function picker.beforeInit(sender, config){ config.highlightDates = []; config.enablePickerHighlight=true; } Thanks for your patience, I learned a lot, actually.
  25. Well, it is global. This Ext.Override is pretty destructive it breaks every other picker in the application
  • Create New...