(http://img516.imageshack.us/img516/7152/gdtabsyq9.png)
This is my latest custom control made from zero :lol
Goddamn Tabs
It supports the following set of messages:
; occurs when new tab is added ; user sends it
GDTM_ADD equ WM_USER+1300
; occurs when a tab is closed ; system sends it
GDTM_CLOSED equ WM_USER+1301
; occurs when a tab is activated ; system sends it
GDTM_ACTIVATED equ WM_USER+1302
; occurs when an attempt to get text of particular tab is made ; user sends it
GDTM_GETTEXT equ WM_USER+1303
; occurs when an attempt to set text of particular tab is made ; user sends it
GDTM_SETTEXT equ WM_USER+1304
; occurs when an attempt to retrieve an index of active tab is made ; user sends it
GDTM_GETACTIVE equ WM_USER+1305
The good thing about this control is that you can draw your own tabs and make them look as you like, and no modifications needed just recompile. Tab's height is estimated by background image height. Tab's or background's width don't matter. Each tab displays up to 10 characters, max 512 tabs there can be.
I haven't made lib or dll, it's up to you to decide how you want it.
Source code & demonstration in the attachment.
Update:
-fixed the millennium bug;
-fixed bug when in one rare case there could appear two selected tabs
-fixed bug when in few rare cases over-state couldn't go off after moving mouse to right
+now GDTM_ACTIVATED returns previous active & current active tabs, so there is no need to hide every window & show one, instead just hide one & show one
[attachment deleted by admin]
excellent work
i needed it
keep up the good work ramguru :U
Thanks for your nice feedback :8)
Hi ramguru
Very nice work! :U
Currently I'm working on rewriting some controls from zero.
Maybe I can use your code when I decide to code the Tab control for OA32?
Regards,
Biterider
Thanks, Biterider
Of course you can use my code in your projects, everyone are welcome to :U
BTW. the control uses ATL thunking to support multiple instances. So it maybe hard to analyze the code.
Later after a while I probably will upload some other tab themes.
Hi Ramguru, I'm having some difficulty with your demo. (I have not had time to test the control for myself yet.) When I run tabs.exe it draws only the two tab arrows on the far left - no tabs. However, the three tabs will appear if I move the window (likely WM_PAINT is called and the buttons are then drawn.) Now the third tab is default selected, and no other tab can be selected. I can click them and the main window contents will change, but the tab highlights do not change. Nor am I able to "add tab." Then the text font of Tab_2 changed to Arabic (I have East Asian font support enabled.) I'll try to look into it more later. XP Pro, AMD XP 2500+
:S hmm this is strange, maybe it's 'cuz I'm using brushes & PatBlt, will try to reproduce bugs, to fix...something. Thanks for report Mark.
Hey, Mark
Did something change I've updated the attachment
Quote from: Mark Jones on August 18, 2007, 09:37:29 PM
Nor am I able to "add tab."
This was my fault, I didn't remove some debug info...
EDIT> Also what is your video card?
EDIT>> I have:
XP Pro & Amd XP 1800+ & ATI 9500;
XP Pro & Core Duo T2500 & Intel 950GM;
on both systems tabs work fine
and that Arabic font just blows my mind :) have no idea how could it happen
Quote from: ramguru on August 18, 2007, 10:16:29 PM
Hey, Mark
Did something change I've updated the attachment
Yes that helped a little, now it opens with the tabs displayed, but Tab_3 remains selected and clicking the other tabs still does not "highlight" them. I can add a tab now using the "Add Tab" button, but it will not display until the grey right-arrow button is clicked or the window is moved. Then the right-arrow button changes to the active color, and both arrow buttons "freeze" and do not function as intended. Very strange indeed, especially considering we have similar hardware.
Quote from: ramguru on August 18, 2007, 10:16:29 PM
EDIT> Also what is your video card?
EDIT>> I have:
XP Pro & Amd XP 1800+ & ATI 9500;
XP Pro & Core Duo T2500 & Intel 950GM;
on both systems tabs work fine
and that Arabic font just blows my mind :) have no idea how could it happen
Video card is a 256MB GeForce Fx5600 Ultra. I have the instrumented nVidia drivers installed (which did cause one obscure problem last year, although I forget the details now.) See this (http://developer.nvidia.com/object/nvperfkit_home.html) for more info about the driver. As for the Arabic font, I think it being Arabic was random and it could have been any font. I can't seem to reproduce it now. But enabling East-Asian Language Support seems to turn on the ability to display anything as a font. For instance it will try to display RadASM language choices in their native fonts even though I do not have those fonts installed. The result is some strange mappings. As for why this would happen to tabs.exe, I have no idea.
Thanks for info Mark, but I have no cure for your case yet. Trying to persuade some fox who own NVidia into testing, will see how it goes.
As for today: I made third update, serious one. Check it out (http://www.masm32.com/board/index.php?topic=7784.msg57179#msg57179) :U
Hi Ramguru, I've looked at the code somewhat. It seems like the problem likely could be something with TrackMouseEvent, as the tabs do not seem to respond to mouse position as they should. Here (http://msdn2.microsoft.com/en-us/library/ms646265.aspx) is a link to MSDN info, I'll try looking at it more later today when I have time.
The problem is that I cannot find any problem in code :lol but thanks for your time.
I'm using TrackMouseEvent just for one reason: when user moves mouse cursor up in non-client area (caption) or outside its client area there is no way to determine it, but use TrackMouseEvent API. So if it was the case you still would be able to change tabs highlight them with mouse. Just so you know I'm not giving up :)
EDIT> Maybe your video card lacks some kind of GDI acceleration :green a wild guess :green2
I made a screen-cast (http://geek.php0h.com/GDTabs/GDTabs.html) demonstrating the control in action. So if you see it not behaving like that please (if you can & have time) upload a screen shot somewhere in imageshack. I still don't know exactly where the problem is.
Hello:
Great tab control ! I tested it on my PC with Nvidia G-Force 6600 GT, it works just like in the screen-cast movie.
Thanks,
SS
Thanks, SideSwipe
I'm happy to hear you liked it.
It's nice to receive more feedback, and thanks again for info you gave.
Apart from Mark I found one person who's experiencing the same symptoms (he has 7300 GT), so now to end this quest I need to find out what they have in common. Maybe it has to do with their video drivers.
Hi ramguru
nice to see your another god damn project ;)
I like your screen, but on my system app doesn't work as expected:
arrows don't work;
when switching tabs, buttons aren't switched (only window);
while resizing I got painting artifacts
If you want so, I can take screenshots for each problem.
My system:
DELL Laptop (Core 2 Duo)
ATI Mobility x1400
WinXP MCE SP2 ENG
(I can provide another info if you need it)
Thanks, Jupiter :bg
You're my saver:
Now it's fact:
That the problem has nothing to do with video card ('caz there are problem on both manufactures: ati, nvidia),
has nothing to do with OS,
and I could 99% assure that it's not related with my code.
so it's obvious that it's a result of something supernatural.
If to be serious...I'm out of ideas :lol
at least 1% that the problem is related to your code ;)
Hi Ramguru, I'm working on a screen capture for GDTabs, might take a bit yet. I cannot view your video, the page just comes up blank - is there any way to link to the file directly? Maybe if I can save it locally it will work.
I appreciate your efforts, Mark
Here is link to zip that contains avi
Hot-linking isn't working so you have to copy-paste it
http://geek.php0h.com/gdtabs_Screen_Stream.zip
The previous link was based on flash...
Thanks again.
Hi ramguru
I attach archive with screenshots (PNG) with 3 bugs illustrated:
GDTabs_Bug_Resize_H_001.png
GDTabs_Bug_Resize_V_001.png
GDTabs_Bug_Wrong_Selection_001.png
as I already mentioned, <> buttons don't work at all.
[attachment deleted by admin]
Thanks for this, I hope I can do something to fix that ::)
Yes I have a problem with flash for some reason. The ActiveX flash-plugin works, but FireFox insists the browser flash-plugin is not installed. Spent a few hours the other day trying to fix it, but gave up after changing registry permissions per Adobe FAQ...
Your capture .avi displays perfectly Ramguru. GDTabs works fine for you, lucky! :-)
Here's my capture in zipped x264/MP2.5 AVI format: Mark-GDTabs (http://heliosstudios.net/temp/Mark-GDTabs.zip)
If you need the decoder, see www.videolan.org/developers/x264.html
I use ffdshow for decoder and configure it to read x264 with "libavcodec."
Thanks, Mark
I appreciate the time you've spent creating that video :U wow and even voice (probably yours) - very cool; :clap:
Quote from: what Mark saidThat's why I said it might have something to do with a ... the mouse position checking code, because it's not noticing that any of this is being highlighted here
I think you made a wrong assumption - mouse position is checked correctly, really, but probably InvalidateRect doesn't invalidate anything, or perhaps SetBrushOrgEx isn't working as expected, or maybe my bitmap split algo isn't doing its stuff. I can only guess, the worst moment is that I cannot make small changes and be sure it will fix these problems, 'cuz I don't see any problem on my PC...but I swear to fix everything :)
OK I made a little program that may detect what exactly is wrong (small chances of that, but any is better than none :) )
Now please Mark_Jones & Jupiter if you're willing to help run this app and report the results :) thanks in advance.
There are 4 tests to check :)
[attachment deleted by admin]
Hi ramguru
Test results:
1. bitmap split | OK |
2. SetBrushOrgEx + PatBlt | OK |
3. InvalidateRect 0 | OK |
4. InvalidateRect 1 | OK |
All tests passed OK
P.S. I think that the problem is related to click capture
Thanks now if you could test this... :U
?? do still see many issues ??
[attachment deleted by admin]
this version is more buggy than previous one ;)
click on tab, switch to another app and return - tab disappears ;)
finally there is no tabs at all - only <> buttons
(http://img146.imageshack.us/img146/3128/gdtabsbugtabsdissaper00nj3.png)
Thanks, Jupiter
Maybe renaming project from "goddamn" tabs to "god blessed" tabs could solve the problem :lol
...
I'm starting to lose my patience with this project :'(
Quote from: ramguru on August 27, 2007, 01:10:43 PM
Maybe renaming project from "goddamn" tabs to "god blessed" tabs could solve the problem :lol
:lol
Holy Tabs ;)
what about creating separate class for buttons itself? it will be much easy to test|debug your code imho
Thanks for looking into this Ramguru. I wish I knew more about GDI so I could help you. Squashing bugs can be tough, but also rewarding. :-)
The problem finder seems to work okay, with one minor artifact seen on test 2 (gray background on right side) which may be nothing, see the attached .png file.
The latest GDTabs works the same as previous for me, except for the new tabs created. If I try to close a new tab using it's little bubble, GDTabs crashes. The crash occurs at address 7c90316c, which is NTDLL.DLL at offset 316c. The exception is "Access violation when writing to [00405000]." This is from GDTabs calling RtlMoveMemory with a size argument of FFFFFFFC.
One other thing I just noticed is that if I try to click a tab, then cover GDTabs with another window, and click GDTabs in the start bar to bring it to the front again, the correct tab will now be shown. This is repeatable. Hope this helps. :U
[attachment deleted by admin]
Quote from: Mark Jones on August 27, 2007, 01:49:46 PM
with one minor artifact seen on test 2
I see you notice every detail :U - however, this one is with no importance :(
Quote from: Mark Jones on August 27, 2007, 01:49:46 PM
If I try to close a new tab using it's little bubble, GDTabs crashes. The crash occurs at address 7c90316c, which is NTDLL.DLL at offset 316c. The exception is "Access violation when writing to [00405000]." This is from GDTabs calling RtlMoveMemory with a size argument of FFFFFFFC.
Yeah I was inattentive, made few mistakes, this was one of them, just hoped everything with drawing will be alright this time - was wrong :)
Quote from: Mark Jones on August 27, 2007, 01:49:46 PM
One other thing I just noticed is that if I try to click a tab, then cover GDTabs with another window, and click GDTabs in the start bar to bring it to the front again, the correct tab will now be shown. This is repeatable. Hope this helps. :U
Thanks for letting me know.
I'm still trying...to fix...
Finally the millennium bug is fixed :U (check first post)
Big thanks go to Jupiter & Mark_Jones
to ramguru
thanks however the first release has by me works on winxpsp2
great works :U
greets
ragdog
Woohoo that did it! So it was a millennium bug eh? :bg
This may be a difficult request, but do you think it would be possible to incorporate tab-stops on each tab or the tab-bar? That way a blind user or one without a mouse could still use this control. Just an idea, may be too much work. Thanks for working so hard on this. :clap:
Quote from: Mark Jones on August 28, 2007, 04:29:18 PM
This may be a difficult request, but do you think it would be possible to incorporate tab-stops on each tab or the tab-bar?
I can try...if I succeed it will be in the next release (tab - for next_tab, shift_tab - for previous)
Thanks, ragdog for good words!
Very nice work ramguru :U
This will definitely come in handy for a skinned app I'm working on :bg
Thanks
Great work :U
Works fine here (XP Pro SP2 32bit, GeForce 8600GT, Core 2 Duo E6550).
As a small suggestion, you could make a tab to also close if you middle-mouse-click on it, possibly an optional feature.
WoW! It's very nice!
awesome job :D I found this source years ago to a dll, guy wrote it in masm, it let you visually draw controls, then it'd generate the win api code, I wish I cud find that damn source again, i'd love to add this control to it, and others, so can draw visually.
can someone repost it (GDTAbs) please ?
Best Regards,
guga
i think this is it
Hi Dave,
I assume that is from Hutch's new archive? You could just
supply a link to save space? (What would be nice is if the
"deleted" message supplied the name of the file or a link to it.)
$0.02,
Steve
EXcelent work....Many tks
http://www.masmforum.com/archive2012/4099_GDtabs_4ed.zip
actually, i couldn't find it in the archive my first pass - but there it is :P
Works perfectly with a few changes:
include \masm32\include\masm32rt.inc
DlgProc PROTO :HWND,:UINT,:WPARAM,:LPARAM
; include tabs.inc
:wink