#1 2012-06-01 15:07:52

lele9
Member
Registered: 2011-10-28
Posts: 170

TSQLCustomToolBar with TAdvOfficePage

hi,
can i use TSQLCustomToolBar with something else of TCustomForm, TSynPager and TSynPage?
i see the code and if i pass something else i falling in assert(false).
i would like to use TSQLCustomToolBar to create a toolbar from enum in a specific TAdvOfficePage that i have.
its possible?
thanks,
Emanuele.

Offline

#2 2012-06-01 17:50:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: TSQLCustomToolBar with TAdvOfficePage

You can use TMS components with the units.
Just define the USETMSPACK compilation conditional in the project properties.

See http://synopse.info/forum/viewtopic.php?id=280 for screenshot with either VCL either TMS components ribbon.
smile

Offline

#3 2012-06-01 18:05:47

lele9
Member
Registered: 2011-10-28
Posts: 170

Re: TSQLCustomToolBar with TAdvOfficePage

ooooooohhhhh
sorry...it's friday...!!

Offline

#4 2012-06-12 09:58:54

lele9
Member
Registered: 2011-10-28
Posts: 170

Re: TSQLCustomToolBar with TAdvOfficePage

hi ab,
excuse me but i try this code with USETMSPACK defined

tb: TSQLCustomToolBar;

tb.Init(self, TypeInfo(TmieAction),prova,nil,''); //self is TForm

and create the toolbar in my form, but if i would like to create the toolbar in an advofficepager that is in the form how can i do?
if try this

tb: TSQLCustomToolBar;

tb.Init(AdvOfficePager1, TypeInfo(TmieAction),prova,nil,''); //AdvOfficePager1 is TAdvOfficePager

i have assert false because TAdvOfficePager isnt a tsynpager.
thanks,
Emanuele.

Offline

#5 2012-06-12 10:44:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: TSQLCustomToolBar with TAdvOfficePage

If you define USETMSPACK, in fact TSynPager is an alias to TAdvToolBarPager.
IMHO a possibility is to define the TSynPager from code, via AdvOfficePager1 := TAdvToolBarPager.Create(....).

But you can note that:

type
  TSynToolButton = TAdvGlowButton;
  TSynPopupMenu = TAdvPopupMenu;
  TSynBodyPage = TAdvOfficePage;
  TSynBodyPager = TAdvOfficePager;

So you can just use your AdvOfficePager1 instance for this constructor:

TSQLRibbonTab.Create(AdvOfficePager1 ,....)

Offline

#6 2012-06-12 11:02:56

lele9
Member
Registered: 2011-10-28
Posts: 170

Re: TSQLCustomToolBar with TAdvOfficePage

hi ab,
maybe there is something that i dont understand because dont work.
can u show me an example with a toolbar created from enum in a tms component that i put manually in the form?

Offline

#7 2012-06-12 11:05:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: TSQLCustomToolBar with TAdvOfficePage

You have to create a TSynPager from code, assign it to your AdvOfficePager1 as parent, then use TSQLCustomToolBar.Init() on this TSynPager.

You'll need the additional methods defined in TSynPager to work with TSQLCustomToolBar. A plain TAdvToolBarPager is not enough.

Offline

Board footer

Powered by FluxBB