Author Topic: Toolbar problem  (Read 5745 times)

0 Members and 2 Guests are viewing this topic.

Aurel

  • Guest
Toolbar problem
« on: December 22, 2012, 12:56:58 PM »
I am really puzzled what might be wrong with creating standard toolbar.
Infact toolbar is (so called created) visble but is not leyerd to parent window.
And not respond on xpmanifest at all( i mean on hot tracking).
Button added to toolbar respond on click but styles are messed.
I have try same way in many other compilers /interpreters and in all work properly
so why not work in oxygen  ???

here is function:
Code: [Select]
'toolbar32
Function SetToolbar (byval _tbhwnd as INT,byval _tx as INT,byval _ty as INT,byval _tw as INT,byval _th as INT,byval _tbflag as INT,byval _ex as INT,byval cID as INT) As INT
INT _hfont
% TBSTYLES = WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT
  If _tbflag=0
    _tbflag= TBSTYLES | _tbflag
 
  End If
 hTBControl = CreateWindowEx(_ex,"ToolBarWindow32","",_tbflag,_tx,_ty,_tw,_th,_tbhwnd,cID,0,0)
_hfont = GetStockObject(17)
 SendMessage hTBControl,WM_SETFONT,_hfont,0
INT lngStyle=0
'lngStyle = SendMessage hTBControl, TB_GETSTYLE, 0, 0
'lngStyle = lngStyle |  CCS_NODIVIDER | TBSTYLE_TOOLTIPS
'SendMessage hTBControl, TB_SETSTYLE, 0, lngStyle
'UpdateWindow _tbhwnd

Function = hTBControl

End Function

Charles Pegge

  • Guest
Re: Toolbar problem
« Reply #1 on: December 22, 2012, 02:00:27 PM »

I don't really understand manifests, Aurel. Are they patched in as a resource?

Aurel

  • Guest
Re: Toolbar problem
« Reply #2 on: December 22, 2012, 02:45:47 PM »
No.
Is added as separate xml file like
myprog.exe.manifest

Charles Pegge

  • Guest
Re: Toolbar problem
« Reply #3 on: December 22, 2012, 03:18:14 PM »
Does it have to be linked into the exe file as a resource?

Aurel

  • Guest
Re: Toolbar problem
« Reply #4 on: December 22, 2012, 11:11:36 PM »
Charles...
manifest can be added as resource but in my case is external file.
For example in FreeBasic i use example toolbar.bas which is by default without
manifest,ok.
Then i add manifest file toolbar.exe.manifest and everything work as espected
but same program not respond and not work properly in oxygen.
I really dont get it why?

Charles Pegge

  • Guest
Re: Toolbar problem
« Reply #5 on: December 23, 2012, 03:44:32 AM »

Do you normally put the manifest in the same folder as the exe?. You may need to execute your application outside the IDE so it can locate the manifiest.

Charles

Aurel

  • Guest
Re: Toolbar problem
« Reply #6 on: December 23, 2012, 04:38:46 AM »
Quote
Do you normally put the manifest in the same folder as the exe?
Of course Charles i do this.
As i say something is wrong and i can't figured what is  ::)

You have FreeBasic ,right?
Try example toolbar.bas, then add manifest in same folder where is compiled exe
and you will see that manifest work.
I look into many many examples and seems that creating toolbar work fine.


Aurel

  • Guest
Re: Toolbar problem
« Reply #7 on: December 23, 2012, 10:09:37 AM »
Hmm
It looks that toolbar will be real nightmare.
I think before that tabcontrol will be tuff but is piece of cacke
comparing to toolbar.

JRS

  • Guest
Re: Toolbar problem
« Reply #8 on: December 23, 2012, 02:19:12 PM »
I can confirm that the manifest file method of providing the theme doesn't work with my O2 IUP example but does work fine with SB.


Charles Pegge

  • Guest
Re: Toolbar problem
« Reply #9 on: December 23, 2012, 05:24:06 PM »
Could you post the manifest file please. I have downloaded FB .24 and I do not see any manifest file connected with examples/windows/gui/toolbar.


PS: I am modifying Oxygen source code to compile with FB version 0.24 (was 0.21)

« Last Edit: December 23, 2012, 06:47:44 PM by Charles Pegge »

JRS

  • Guest
Re: Toolbar problem
« Reply #10 on: December 23, 2012, 08:38:58 PM »
Quote
PS: I am modifying Oxygen source code to compile with FB version 0.24 (was 0.21)

I thought O2 was self compiling at this point.  :'(


Charles Pegge

  • Guest
Re: Toolbar problem
« Reply #11 on: December 23, 2012, 09:28:16 PM »
Not while I am changing the architecture so much. Oxygen would need to be frozen for several months to make that transition. FB actually does a very good job. I use it in a simple procedural way and it is fast and rock solid.

is this the correct manifest to use? for Toolbar?.

Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
      <application>
        <!--This Id value indicates the application supports Windows Vista functionality -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
        <!--This Id value indicates the application supports Windows 7 functionality-->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      </application>
  </compatibility>

  <assemblyIdentity type="win32"
                    name="myOrganization.myDivision.mySampleApp"
                    version="6.0.0.0"
                    processorArchitecture="x86"
                    publicKeyToken="0000000000000000"
  />
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32"
                        name="Proseware.Research.SampleAssembly"
                        version="6.0.0.0"
                        processorArchitecture="X86"
                        publicKeyToken="0000000000000000"
                        language="*"
      />
    </dependentAssembly>
  </dependency>
</assembly>

JRS

  • Guest
Re: Toolbar problem
« Reply #12 on: December 23, 2012, 09:44:54 PM »
Quote
FB actually does a very good job. I use it in a simple procedural way and it is fast and rock solid.

I'm totally confused why the FreeBASIC group didn't jump all over O2 as their compiler of the future seeing that it was written in FB legacy. Even their author has gone MIA on the development front. Good thing the janitor is still around to cleanup the minor messes users find.


Aurel

  • Guest
Re: Toolbar problem
« Reply #13 on: December 23, 2012, 10:38:27 PM »
Charles ...
It is not problem in manifest ( i use 0.21 to ) ,i just download 0.24 to test Vanya PureBasic like
wrapper.
It is problem in toolbar butttons which must be added in different way then standard button
class "button".
Toolbar buttons need to be defined as array.
Second thing...this buttons must be part of TOOLINFO structure.
That is main problem,so when i would be capable to addbutton i think that then manifest would work.
sorry for confusion...

Aurel

  • Guest
Re: Toolbar problem
« Reply #14 on: December 24, 2012, 03:14:11 PM »
So i tray create TBBUTTON structure.
Code: [Select]
TOOLBAR constants (styles) <<<<<<<<<<<<<<<<<<<<<<<<<<<<
% TBSTYLE_BUTTON = &H0
% TBSTYLE_SEP = &H1
% TBSTYLE_TOOLTIPS = &H100
% TBSTYLE_FLAT = &H800
% TB_ENABLEBUTTON         = (WM_USER + 1)

% TB_ADDBUTTONS = (WM_USER + 20)
% TB_INSERTBUTTON = (WM_USER + 21)
% TB_SETBITMAPSIZE = (WM_USER + 32)
% TB_SETBUTTONWIDTH = (WM_USER + 59)
% TB_SETBUTTONSIZE = (WM_USER + 31)
% TB_SETSTYLE = WM_USER + 56
% TB_GETSTYLE = WM_USER + 57
% TBSTYLE_WRAPABLE = &H200
% CCS_ADJUSTABLE   = &H0000020
% TBSTYLE_LIST = &H1000
% TBSTYLE_BUTTON =&H0
% CCS_NODIVIDER = 0x00000040

% TB_BUTTONSTRUCTSIZE     = (WM_USER + 30)
% TB_ADDBUTTONS           = (WM_USER + 20)
% TB_INSERTBUTTON         = (WM_USER + 21)
% TB_DELETEBUTTON         = (WM_USER + 22)

'tollbar structure..............................
TYPE TBBUTTON
    INT      iBitmap
    INT      idCommand
    BYTE     fsState
    BYTE     fsStyle
    DWORD   dwData
    SYS     iString

END TYPE
and then in main code try fill this :
Code: [Select]
'toolbar control ------------------------------------------------
INT hToolBar
hToolbar = SetToolbar(win,0,0,0,0, 0 , 0 ,tbID)
'----------------------------------------------------------------
'def toolbar array
Dim tbb[3] as TBBUTTON
'add toolbar button
 tbb[0].iBitmap  = 0                'no bitmap
 tbb[0].idCommand = 4            ' toolbar ID
 tbb[0].fsState   = 8 ' tb state
 tbb[0].fsStyle   = TBSTYLE_BUTTON  ' tb style
 tbb[0].dwData    = 0
 tbb[0].iString   = strPtr "New"

SendMessage hToolBar,TB_ADDBUTTONS,1,&tbb
Updatewindow htoolbar

And still nothing...
It looks that something missing..
i suspect on bReserwed[]... ::)