Jump to content

Problems trying to change the Theme


Guest

Recommended Posts

Message from: "Farshad Mohajeri"

 

If you've replicated same code in demo it should work. Can you paste your

code here?

 

"Antonio G. Gutierrez" wrote in message

news:QujFJXD8LHA.3976@anaxagvs227...

> Greetings, I tried to change the Theme to choose their means by the user,

> so I follow the demo and megademo fishfact and not make the change .. any

> suggestions?

>

 

 

.

 

Link to comment
Share on other sites

Message from: "Antonio G. Gutierrez"

 

Hola, gracias por tu interés, a continuación te pongo el código que no me

funciona para cambiar el Theme..el primero es el Uniserver y después el

evento onclick para cambiar dicho theme.

 

unit ServerModule;

 

interface

 

uses

SysUtils, UniGUIServer, UniGUIMainModule;

 

type

TUniServerModule = class(TUniGUIServerModule)

procedure UniGUIServerModuleCreate(Sender: TObject);

private

{ Private declarations }

protected

procedure FirstInit; override;

public

{ Public declarations }

CurrentTheme : string;

end;

 

function UniServerModule: TUniServerModule;

 

implementation

 

{$R *.dfm}

 

uses

UniGUIVars;

 

function UniServerModule: TUniServerModule;

begin

Result:=TUniServerModule(UniGUIServerInstance);

end;

 

procedure TUniServerModule.FirstInit;

begin

InitServerModule(Self);

end;

 

procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);

begin

 

UniServerModule.ServerRoot:=GetCurrentDir;

UniServerModule.ExtRoot:=GetCurrentDir+'\ext-3.3.0';

 

 

end;

 

initialization

RegisterServerModuleClass(TUniServerModule);

end.

 

 

Now Onclick event.

 

procedure TMainForm.bcambiartemaClick(Sender: TObject);

begin

 

UniServerModule.Lock;

try

UniServerModule.CurrentTheme:='classic';

finally

UniServerModule.UnLock;

end;

TUniGUIApplication(UniApplication).Restart;

 

 

 

 

end;

 

 

 

 

 

 

 

 

 

"Farshad Mohajeri" escribió en el mensaje

news:hCS6EJJ8LHA.3976@anaxagvs227...

> If you've replicated same code in demo it should work. Can you paste your

> code here?

>

> "Antonio G. Gutierrez" wrote in message

> news:QujFJXD8LHA.3976@anaxagvs227...

>> Greetings, I tried to change the Theme to choose their means by the user,

>> so I follow the demo and megademo fishfact and not make the change .. any

>> suggestions?

>>

>

>

 

 

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

In unit MainModule.pas add the following:

 

procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);

begin

Theme:=UniServerModule.CurrentTheme;

end;

 

"Antonio G. Gutierrez" wrote in message

news:eLt7lbs8LHA.1984@anaxagvs227...

> Hola, gracias por tu interés, a continuación te pongo el código que no me

> funciona para cambiar el Theme..el primero es el Uniserver y después el

> evento onclick para cambiar dicho theme.

>

> unit ServerModule;

>

> interface

>

> uses

> SysUtils, UniGUIServer, UniGUIMainModule;

>

> type

> TUniServerModule = class(TUniGUIServerModule)

> procedure UniGUIServerModuleCreate(Sender: TObject);

> private

> { Private declarations }

> protected

> procedure FirstInit; override;

> public

> { Public declarations }

> CurrentTheme : string;

> end;

>

> function UniServerModule: TUniServerModule;

>

> implementation

>

> {$R *.dfm}

>

> uses

> UniGUIVars;

>

> function UniServerModule: TUniServerModule;

> begin

> Result:=TUniServerModule(UniGUIServerInstance);

> end;

>

> procedure TUniServerModule.FirstInit;

> begin

> InitServerModule(Self);

> end;

>

> procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);

> begin

>

> UniServerModule.ServerRoot:=GetCurrentDir;

> UniServerModule.ExtRoot:=GetCurrentDir+'\ext-3.3.0';

>

>

> end;

>

> initialization

> RegisterServerModuleClass(TUniServerModule);

> end.

>

>

> Now Onclick event.

>

> procedure TMainForm.bcambiartemaClick(Sender: TObject);

> begin

>

> UniServerModule.Lock;

> try

> UniServerModule.CurrentTheme:='classic';

> finally

> UniServerModule.UnLock;

> end;

> TUniGUIApplication(UniApplication).Restart;

>

>

>

>

> end;

>

>

>

>

>

>

>

>

>

> "Farshad Mohajeri" escribió en el mensaje

> news:hCS6EJJ8LHA.3976@anaxagvs227...

>> If you've replicated same code in demo it should work. Can you paste your

>> code here?

>>

>> "Antonio G. Gutierrez" wrote in message

>> news:QujFJXD8LHA.3976@anaxagvs227...

>>> Greetings, I tried to change the Theme to choose their means by the

>>> user, so I follow the demo and megademo fishfact and not make the change

>>> .. any suggestions?

>>>

>>

>>

>

>

 

 

.

 

Link to comment
Share on other sites

Message from: "Antonio G. Gutierrez"

 

Thanks, everything works beautifully

"Farshad Mohajeri" escribió en el mensaje

news:Q0CSQDt8LHA.1984@anaxagvs227...

> In unit MainModule.pas add the following:

>

> procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject);

> begin

> Theme:=UniServerModule.CurrentTheme;

> end;

>

> "Antonio G. Gutierrez" wrote in message

> news:eLt7lbs8LHA.1984@anaxagvs227...

>> Hola, gracias por tu interés, a continuación te pongo el código que no me

>> funciona para cambiar el Theme..el primero es el Uniserver y después el

>> evento onclick para cambiar dicho theme.

>>

>> unit ServerModule;

>>

>> interface

>>

>> uses

>> SysUtils, UniGUIServer, UniGUIMainModule;

>>

>> type

>> TUniServerModule = class(TUniGUIServerModule)

>> procedure UniGUIServerModuleCreate(Sender: TObject);

>> private

>> { Private declarations }

>> protected

>> procedure FirstInit; override;

>> public

>> { Public declarations }

>> CurrentTheme : string;

>> end;

>>

>> function UniServerModule: TUniServerModule;

>>

>> implementation

>>

>> {$R *.dfm}

>>

>> uses

>> UniGUIVars;

>>

>> function UniServerModule: TUniServerModule;

>> begin

>> Result:=TUniServerModule(UniGUIServerInstance);

>> end;

>>

>> procedure TUniServerModule.FirstInit;

>> begin

>> InitServerModule(Self);

>> end;

>>

>> procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);

>> begin

>>

>> UniServerModule.ServerRoot:=GetCurrentDir;

>> UniServerModule.ExtRoot:=GetCurrentDir+'\ext-3.3.0';

>>

>>

>> end;

>>

>> initialization

>> RegisterServerModuleClass(TUniServerModule);

>> end.

>>

>>

>> Now Onclick event.

>>

>> procedure TMainForm.bcambiartemaClick(Sender: TObject);

>> begin

>>

>> UniServerModule.Lock;

>> try

>> UniServerModule.CurrentTheme:='classic';

>> finally

>> UniServerModule.UnLock;

>> end;

>> TUniGUIApplication(UniApplication).Restart;

>>

>>

>>

>>

>> end;

>>

>>

>>

>>

>>

>>

>>

>>

>>

>> "Farshad Mohajeri" escribió en el mensaje

>> news:hCS6EJJ8LHA.3976@anaxagvs227...

>>> If you've replicated same code in demo it should work. Can you paste

>>> your code here?

>>>

>>> "Antonio G. Gutierrez" wrote in message

>>> news:QujFJXD8LHA.3976@anaxagvs227...

>>>> Greetings, I tried to change the Theme to choose their means by the

>>>> user, so I follow the demo and megademo fishfact and not make the

>>>> change .. any suggestions?

>>>>

>>>

>>>

>>

>>

>

>

 

 

.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...