B4J Library Replacement TitleBar

behnam_tr

Active Member
Licensed User
Longtime User
@behnam_tr I've included the Override amendment in V1.1 with a couple of bug fixes. If you haven't tried it yet, download the latest version.

thanks man
but new problem in v1.1
titlebar is hidden and i cant click on min or max button or moving form

i changed this line

MainForm.WindowTop = CenterY - MainForm.WindowHeight + 25
now can see titlebar
but taskbar problem not solved yet
of course its ok when snapping to right or left
when maximized boooooooooooom !! taskbar going to back.
windows 7
1366*768 resolution
 

Attachments

  • Untitled.png
    117.9 KB · Views: 330
  • Untitled2.png
    98.6 KB · Views: 324
Last edited:

stevel05

Expert
Licensed User
Longtime User
Ok so to recap, this is a problem on Windows 7. does your code in post #13 solve it?

If you want to hide the task bar, the screen needs to be set to FullScreen. (which I had not tested and needs some work)
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
Update V1.2
  • Implemented FullScreen Mode
  • Bug Fixes
See first post
 

stevel05

Expert
Licensed User
Longtime User
Has anybody tried this on Linux? I've just installed Ubuntu in Virtualbox on Win 10 and I tried it as a test. Quite disappointing that maximize doesn't work. I wondered if it is because it's a virtual machine, or just not working on Linux/Ubuntu full stop.
 

stevel05

Expert
Licensed User
Longtime User
Update V1.3
  • Added Snapping background and border colors to designer properties.
  • Fixed bug on Snapping background for multiple screens
  • improved Linux compatibility

I have tried everything I can think of to get Full screen to work on Linux, unfortunately the default windows manager with Ubuntu doesn't play well with JavaFX and has different behaviour to Microsoft windows. So much so that setting the window maximized doesn't work, and it is not possible to move transparent or undecorated windows out of the screen. I have got round the maximized issue by implementing maximized in code. Unfortunately I can't get fullscreen to work at all and am giving up for now but will check later to see if the situation improves.

If you want to use this for Linux, then it does everything except fullscreen. Also, the performance in debug causes a few issues, so if you look in the code, there are different delays set for debug and release. If this still doesn't work you can try lengthening the delays.

Results may differ with different Linux windows managers so if you want to test it on whichever version of linux you use, let me know the results. It would be nice to get this working for Windows, Linux and Mac (which I can't test so will be reliant on feedback).
 
Last edited:

behnam_tr

Active Member
Licensed User
Longtime User
problem in right_to_left Forms !!

hi @stevel05

When the form orientation is Right_to_left, Resize of the form as well as the arrangement of the buttons is disrupted
arrangement of the buttons can fix with this code
B4X:
Dim jo As JavaObject = TitleBarBG
    jo.RunMethod("setNodeOrientation", Array("LEFT_TO_RIGHT"))

But resizing the form is still a problem

sample attached.
 

Attachments

  • TitleBar1_RTL.rar
    36.7 KB · Views: 228

stevel05

Expert
Licensed User
Longtime User
Needless to say, I hadn't even thought of Right_To_Left Orientation.

Try this one (Based on your version)

Attachment removed
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
Try removing the line:
NodeOrientation = "LEFT_TO_RIGHT":
from the set orientation sub, my mistake, it's not needed
 

stevel05

Expert
Licensed User
Longtime User
Tidied up a bit and removed the above code. Sets the title orientation if needed

Attachment removed
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
@behnam_tr let me know if this stands up and I will release as a new version.

Thanks
 

behnam_tr

Active Member
Licensed User
Longtime User
@behnam_tr let me know if this stands up and I will release as a new version.

Thanks

Yes, it is absolutely great
thank you
If possible, please add two options
To become more practical and complete

B4X:
#DesignerProperty: Key: ShowIcon, DisplayName: Show Icon, FieldType: Boolean, DefaultValue: False, Description: Show/hide the Form icon
#DesignerProperty: Key: ShowMaximize, DisplayName: Show Maximize, FieldType: Boolean, DefaultValue: False, Description: Show/hide the maximize button
 

stevel05

Expert
Licensed User
Longtime User
OK, while your in test mode, try this one (Defaults are true)

Attachment removed
 
Last edited:

behnam_tr

Active Member
Licensed User
Longtime User
OK, while your in test mode, try this one (Defaults are true)

problem in maxzimized(with double click on title)
problem in restored

showmaximaize = false
=====================
minimize is ok
show/hide icon is ok
 

Attachments

  • rtitle.png
    10.2 KB · Views: 222
Last edited:

stevel05

Expert
Licensed User
Longtime User
problem in maxzimized(with double click on title)
problem in restored
What problem are you seeing looks OK here, unless you want to disable double click as well?
 

stevel05

Expert
Licensed User
Longtime User
Yep I see it, forgot a sleep statement.

Now happens when window is resized, will take a look
 

Attachments

  • TitleBarR_L.zip
    37.6 KB · Views: 202

behnam_tr

Active Member
Licensed User
Longtime User
Yep I see it, forgot a sleep statement.

Now happens when window is resized, will take a look

not solved yet !!

When maximize is false, the position of the minimize icon should be attached to the close icon and the space between the two should be removed.
 

Attachments

  • after_resize.png
    9.4 KB · Views: 201
  • OnLoad.png
    8.3 KB · Views: 201

stevel05

Expert
Licensed User
Longtime User
Yes, will take a bit more work. I have to go out now, will look later.
 

stevel05

Expert
Licensed User
Longtime User
Had an idea before I go out, try this one. If you are copying code into an existing project, you will need to copy the titlebar layout or turn off the Handle Resize Event option.
 

Attachments

  • TitleBarR_L.zip
    37.7 KB · Views: 211
Cookies are required to use this site. You must accept them to continue using the site. Learn more…