Jump to content

Problems trying to change the Theme


Guest

Recommended Posts

Message from: "Antonio G. Gutierrez"

 

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"

 

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...