-
Posts
635 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Posts posted by artem_niko
-
-
10 hours ago, Sherzod said:
Hello,
Do you mean axes?
Yes
-
Hello!
How change color of this black horizontal and vertical line (not found property)?
-
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. -
Hello, again!)
Well, I'll try to explain what I've done so far.
So, in the main application, I prescribed:... private procedure SetGlobalValue_UnloadingBPL(const Value: HModule); public test1, test2: HModule; //test1 - что передаю, test2 - для обратного получения в главное приложение property GV_UnloadingBPL: HModule read UnloadingBPL write SetGlobalValue_UnloadingBPL; ...
The code of the button for passing the variable to the frame:
... if IsPublishedProp(Frame1,'GV_UnloadingBPL') then SetPropValue(Frame1,'GV_UnloadingBPL',test1); ...
Now I get my variable in the frame itself:
... private procedure SetGlobalValue_GettingBPL(const Value: HModule); public FG_GettingValue: HModule; //куда запоминаю переменную property GV_UnloadingBPL: HModule read FG_GettingValue write SetGlobalValue_GettingBPL; ...
Code for getting a variable in a frame:
procedure TUniFrameG1.SetGlobalValue_GettingBPL(const Value: NativeUInt); begin FG_GettingValue:=Value; end;
And here is the code when the frame closes (it closes by timer):
procedure TUniFrameG1.UniTimer_CloseTimer(Sender: TObject); begin if IsPublishedProp(Self,'test2') then SetPropValue(Self,'test2',FG_GettingValue); end;
Then, I try to unload the BPL in the main program when closing TabSheet1:
procedure TMainForm.UniTabSheet1_Close(Sender: TObject; var AllowClose: Boolean); begin SetGlobalValue_UnloadingBPL(test2); if test2<> 0 then begin ShowMessage('Пакет загружен'); UnloadPackage(test2); end; end;
And so, when doing all this, I get an error in the main program: Invalid package handle
Please, help me...
-
1 minute ago, Sherzod said:
Извините, я так не думаю, например, нет класса rounded ...
Here is class rounded:
.rounded { border-radius: 12px; border-color: #cccccc!important; /*color of border of forms*/ border-width: 0px!; color: #cccccc!important; background-color:#ffffff!important; /*color of form*/ }
-
2 minutes ago, Sherzod said:
Can you make a simple testcase with customCss you are using?
So I have already given an example of the code from my CSS file. Everything related to CSS and what applies to Uipagecontrol is the code above, it makes no sense to make a separate example to apply the same code to it.
I really need to remove this line, it annoys me terribly, but I can't figure out what code to prescribe for it, I've already written it in any way...
-
7 minutes ago, Sherzod said:
Something like this I guess:
CustomCSS ->
.rounded .x-tab-bar-strip { border-color: green; }
No effect...
May be, this is because I'm also using this?
.myNoBorderCSS .x-panel-body-default { background: #ffffff!important; /*color of UniTabSheet*/ border-color: #cccccc!important; color: #cccccc!important; border-width: 0px !important; border-style: none !important; border-top-color: #f5f5f5!important; }
-
1 minute ago, Sherzod said:
Hello,
It seems you have found ->
x-tab-bar-strip
Here is fragment from my CSS file:
._tab-bar .x-tab-bar { background-color: none !important; border-style: transparent !important; background-color: transparent !important; border-color: #ccc !important; border-bottom-color: #cccccc !important; border: none !important; } ._tab .x-tab { background-color:#f3f3f3!important; border-color: #cccccc!important; border-bottom-color: transparent!important; border-top-left-radius: 10px!important; border-top-right-radius: 10px!important; border-bottom-left-radius: 10px!important; border-bottom-right-radius: 10px!important; } ._tab-active .x-tab-active { font-family:Arial,Helvetica,sans-serif!important; font-weight:bold; font-size:14px; background-color: #feffe3!important; border-color: #ccc!important; border-bottom-color: #ccc!important; }
Where should I place the code
x-tab-bar-strip
to change the color of this line?
I apply the class above like this:
-
Good afternoon!
Using F12, I'm trying to find the name of this line in UniPageControl. I need to manage her style through CSS, but as soon as I haven't tried - to no avail.
Here's what F12 shows:How do I write this line in the CSS file correctly, what line should I add that would change its style? For example, change its color.
-
48 minutes ago, Sherzod said:
No problem, add to MainForm.Script
Yes, it seems I added a script to MainForm, the button seems to be created, but it does not "fill" the menu of open tabs (see the Sheets button):
And as for the button on the green panel, I said about it that it would be made on the same level with the tabs, of which I have only 5 pieces fixed. In this button, the menu is filled in as it should, with pictures and working tab navigation...
-
5 minutes ago, Sherzod said:
MainForm.Script
And what about if my UniPageControl1 in UniFrame?
UniFrame have't property Script...
-
4 minutes ago, Sherzod said:
Yes, I understand you. This can be done from the above solution you say. You can try.
I will also try to analyze.I'm deleting from code:
function tabPanel.afterrender(sender, eOpts) { var tabItems=[]; this.tabBar.getRefItems().forEach(function(item,i){ tabItems.push({ icon: item.icon, index: i, text: item.title, handler: function(item){ sender.setActiveItem(item.index) } }) }); var header=this.getHeader(); if (header) { header.setStyle('background', 'red'); header.setStyle('background-color', 'transparent'); header.setStyle('border', 'transparent'); } }
This:
this.addTool({ text: 'Разделы модуля', xtype: 'splitbutton', menu: new Ext.menu.Menu({items: tabItems}) });
And the title with the old button disappeared.
It remains only to understand how to correct and prescribe the filling of the menu and that's it... -
18 minutes ago, Sherzod said:
Try this, just did it again.
1. UniHiddenPanel1 -> UniMenuButton1
2. Form OnReady ->
procedure TMainForm.UniFormReady(Sender: TObject); begin with UniPageControl1.JSInterface do begin JSCall('tabPanel.tabBar.add', [JSObject('xtype: "tbfill"')]); JSCall('tabPanel.tabBar.add', [UniMenuButton1.JSControl]); end; end;
Yes, thanks, it works.
But, how can I prescribe that the menu with the names of tabs is also filled in UniMenuButton1, with the ability to navigate through them, as is done in the case of creating a button with a list with a separate title? -
On 5/15/2022 at 12:21 AM, Sherzod said:
Made the following:
1.
UniMenuButton1
2. UniPageControl1.ClientEvents.ExtEvents -> function tabPanel.afterrender(sender, eOpts)function tabPanel.afterrender(sender, eOpts) { var tabItems=[]; this.tabBar.getRefItems().forEach(function(item,i){ tabItems.push({ index: i, text: item.title, handler: function(item){ sender.setActiveItem(item.index) } }) }); this.addTool({ text: 'Sheets', xtype: 'splitbutton', menu: new Ext.menu.Menu({items: tabItems}) }); }
@Sherzod, this is you code with header...
How make without header?
-
8 minutes ago, Sherzod said:
Ok, I'll try to remember the code I did )
What do you mean?
I'm using you code from your firsts posts...
-
5 minutes ago, Sherzod said:
Well, it's not a good idea if you have many tabs.
Well, I will know in advance the number of tabs, it will not be large so that it would be inconvenient)
But, where there will be a lot of them, I will use the code that is now and create a menu above the tabs, and where there are 3-4 tabs, then you can save space and arrange the menu on the same level with the tabs.How to make the second option?
-
On 8/22/2021 at 10:48 PM, herculanojs said:
Hello!
Is it possible transfer HModule from MainForm, using code?
As, by analogy for string values:
var MyHModuleVar: HMODULE; begin ... if IsPublishedProp(UniFrame1,'GV_Test') then SetPropValue(UniFrame1,'GV_Test',MyHModuleVar); ...
In UniFrame1:
... private procedure SetGlobalValue(const MyHModuleVar: HMODULE); ...
and:
... published property GV_Test: hmodule read GetttingValue write SetGlobalValue;
It seems to work, my HModule variable is passed, but when I use the UnloadPackage(MyHModuleVar) function in UniFrame1, I get an AV error...
-
-
Erroneous double of the post...
-
Erroneous double of the post
-
-
15 minutes ago, bahry said:
если родительским элементом pagecontrol является основная форма
вы можете вызвать mainform.PageControl1.ActivePage.Закрыть;
Well, in general, yes, that's right.
On the MainForm of the main application, I have UniPageControl1, on which UniTabSheet1 is created dynamically and immediately UniFrame1 is loaded dynamically to this tab. Therefore, I need, by clicking on the button on the loaded UniFrame1, to close its parent (UniTabSheet1), which has its parent (UniPageControl1).Will it work?
mainform.PageControl1.ActivePage.Close;
After all, my UniFrame1 knows nothing about UniPageControl1, which is located on MainForm...
Here, I drew a diagram to make it clearer who is the parent of whom:
My code is in the button above - it works, everything closes as it should, but when I reconnect UniFrame1, the updated UniFrame1 does not load, because of this error, most likely:
Or because xxx.dll is not unloaded somehow.
Everything works only after restarting the server, which is not correct. -
Just now, Sherzod said:
Hello,
Just use the Close method.Close=OnClose? This is equivalent?
-
Hello!
How, when clicking on the button, to trigger the onClose event in UniTabSheet?
It doesn't work that way:procedure TUniFrame1.UniFSButtonCloseClick( Sender: TObject); begin // (Parent as TUniTabSheet).OnClose(Sender,caNone); TUniTabSheet(Parent as TUniTabSheet).OnClose(Sender,True); end;
Change color of line in UniChart
in General
Posted
I've reviewed every property. The available properties do not change the color in any way.