Recent

Author Topic: pageconrol drag and drop  (Read 3935 times)

Hansvb

  • Hero Member
  • *****
  • Posts: 825
pageconrol drag and drop
« on: November 02, 2014, 09:00:42 pm »
I a looking for an example of drag and drop a pagecontrol tab of a form on a tab. I want to drag a tab out of the page control en drop it next to the program on the desktop. Is that possible?

kpeters58

  • Sr. Member
  • ****
  • Posts: 267
Re: pageconrol drag and drop
« Reply #1 on: November 03, 2014, 05:38:10 pm »
As what? An image? It will not be easy...

My first thought (if that's good enough for your design dreams):

Create a graphic on the fly, stuff tabsheet's canvas in there, save somewhere and create desktop link for it.

Lazarus 2.0.4/FPC 3.0.4/Win 64

rvk

  • Hero Member
  • *****
  • Posts: 6802
Re: pageconrol drag and drop
« Reply #2 on: November 03, 2014, 05:51:54 pm »
As what? A form? That's much easier to do...  :D

Please specify exactly what you're trying to accomplish.

If you want to drag a tab out of a page control and let it become a form you could also look into using docked forms. But without exactly knowing what you want, we can't show you the best way to do it.

Hansvb

  • Hero Member
  • *****
  • Posts: 825
Re: pageconrol drag and drop
« Reply #3 on: November 03, 2014, 07:15:42 pm »
Situation: I have a pagecontrol on a form. Each tab has a few buttons which execute predifned query's. On the first tab the first query acts like a filter for the query's on the other tabs. So i want to drag the tab next to the window so the tab becomes a new window. Then you can see te "filter query" when you are on other tabs.
So i want to drag it and then the tab must act like a form

rvk

  • Hero Member
  • *****
  • Posts: 6802
Re: pageconrol drag and drop
« Reply #4 on: November 03, 2014, 09:50:27 pm »
If you really want the separate tab to act as a form (which you can drag "off" the form) you'll need to put the logic of that tab in a separate form. You can dock (or embed) that form in a tab of your pagecontrol.

But... the forms wouldn't be physically connected to each other (and you can't program everything in one form). It might be a better idea (reading your "situation") to create an expandable panel in your original form. That way that panel would still be physically connected to your form and you won't need to drag it exactly next to each other.

So you could create a hidden (right or left aligned) panel and when you need it to become visible (or with a big button) you increase the width of the form by the panel-width and make the panel visible (essentially creating a panel which expands the form when needed). (Just an idea) (I have done this with a order-screen where there is a filter-panel which pops in and out with the F3/search-key)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: pageconrol drag and drop
« Reply #5 on: November 04, 2014, 12:31:21 am »
The attached project shows a very simplistic way to have a tabsheet panel that can be dragged on and off a pagecontrol to sit beside it, or to live within it, without disturbing other tabsheets. You may be able to adapt this idea to your needs.

Hansvb

  • Hero Member
  • *****
  • Posts: 825
Re: pageconrol drag and drop
« Reply #6 on: November 04, 2014, 09:29:20 pm »
thanks, i tried it. It's not what i had in mind, but i will look at it.

 

TinyPortal © 2005-2018