-
Posts
333 -
Joined
-
Last visited
-
Days Won
7
Content Type
Profiles
Forums
Events
Posts posted by tappatappa
-
-
2) I define "Images" property on TUniDBLookupComboBox ... hut how can I add image on the list ? I can not display an image in the list.
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
-
wow, what a beautiful bell curve we got!
-
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. -
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);
-
See the test case attached.
-
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);
-
it seems exactly what I tried, only in Delphi
-
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?
-
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
-
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?
-
//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
-
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) {
-
1) I am trying to use icons from here:
When clicking on the "Glyph" property in Delphi and then Clicking "Load" and selecting a PNG sourced from there, the image is loaded and displayed but when you then click OK, an error message "Invalid graphic format" is displayed with call stack as follows:
http://i.imgur.com/wiOns0Z.png
The same happens with a conventional VCL TSpeedButton so it looks like some kind of Delphi bug, but mentioning just in case this is something UniGUI can do something about.
Glyph doesn't work with PNG with Alpha Channel (transparency)
-
2) Additionally I notice TUniSpeedButton has "Images" and "ImageIndex" properties. I'd assumed that assigning a TUniImageList, populating it with PNG (which does work) and setting ImageIndex might cause the button to display the image but this appears to do nothing. Can you clarify whether this is supposed to work or why these properties appear to be ignored?
Thanks
Walter
It does work with TUniBitBtn, I use them a lot in my project. Do you need SpeedButton specifically?
-
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
-
try TUniNativeImageList
- 2
-
Use this approach:
frmEmailSettings.grdEmails.showMask('Loading list...');
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).
-
Any idea on how to add a screenmask?
-
Database components are not included. What is Delphi without Oracle?
-
1) Consider putting the css in ServerModule->CustomCSS.
2) Have you set HTMLFrame::Align = alClient?
-
+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.
-
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
-
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.
-
Well, it is global. This Ext.Override is pretty destructive it breaks every other picker in the application
Sleep Delay In UniGui Application
in General
Posted
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).