Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-03

Linux Clipboard

17 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink
to Hongli Lai: GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. ----------

+ From: Hongli Lai
+
+ GDK needs a GdkWindow. And GdkWindow needs a GtkWidget.

On second thoughts, if you want to do something with the clipboard in WINAPI, you need to open the clipboard first. OpenClipboard needs a window. There you have a GTKwindow you can work with for the other functions. And only one window can open the clipboard.

If you implement the API functs:
OpenClipboard
CloseClipboard
EmptyClipboard
GetClipboardData
SetClipboardData
EnumClipboardFormats

you then are on the way to implement TClipboard.

Marc

Reply by email

Hongli Lai

GDK needs a GdkWindow. And GdkWindow needs a GtkWidget.

----------

Show quoted text 15 lines
Van: Marc Weustink Aan: Onderwerp: RE: Linux Clipboard Datum: woensdag 1 maart 2000 12:16 + From: Hongli Lai + I have some problems implementing the GTK clipboard (selections). + According to the GTK+ documentation, all GTK+ specific + selection functions + needs a GTK widget. + But that isn't available, because TClipboard is a non-visual + component. What aboput GDK ??

Reply by email

Hongli Lai
Sorry ... that message went to the wrong address. Was busy replying to Martin Waldenburg (mwEdit).

OK, I don't mind. Could happen to all of us ;-)

Reply by email

Hongli Lai
Show quoted text 6 lines
Van: Alexander Mehlhorn (AHM) Aan: Onderwerp: RE: [lazarus] Linux Clipboard Datum: woensdag 1 maart 2000 9:16 Verstehe ich das richtig das du schon einen Ersatz fuer TmwEditList hast

?

Kindest regards, Alexander Mehlhorn (AHM)

What do you mean "Verstehe ich das richtig das du schon einen Ersatz fuer TmwEditList hast ?
"?
I don't speak German.

Reply by email

Hongli Lai

I finally find out how to use selections :-)
I want to implement OpenClipboard, CloseClipboard, etc. I need to put that in the WINAPI unit. But what unit is the WINAPI unit? winapi.inc? gtkwinapi.inc? interfaces.pp?

Reply by email

Marc Weustink
to Hongli Lai
Hongli Lai wrote
I finally find out how to use selections :-) I want to implement OpenClipboard, CloseClipboard, etc. I need to put that in the WINAPI unit. But what unit is the WINAPI unit? winapi.inc? gtkwinapi.inc? interfaces.pp?

You have to change 5 files.

headers:
winapih.inc and gtkwinapih.inc

wrappers:
winapi.inc and interfacebase.inc

the actual code:
gtkwinapi.inc

Marc

Reply by email

Hongli Lai
to Marc Weustink: + From: Hongli Lai + + GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. On second…

Op Thu, 02 Mar 2000, schreef Peter Dyson:

Show quoted text 8 lines
> > I usually use the forms hWnd when using the API clipboard. > You could try adding a parent property to the class which is > a TWinControl, the lowest level object in the VCL with a > hWnd > Answering my own message how about TClipBoard.Create(AOwner: TwinControl)

That would be Delphi incompatible. In Delphi, you can access the TClipboard object by using the Clipboard function, which has no parameters. If I add a AOwner parameter to Clipboard, I can't compile existing Delphi apps that use TClipboard anymore without modify the sourcecode.

Reply by email

Peter Dyson
to Marc Weustink: + From: Hongli Lai + + GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. On second…
I don't understand this. According to the Win32 API docs, the first

parameter

of OpenClipboard must be a HWND. What did you mean "OpenClipboard needs a window"?

I usually use the forms hWnd when using the API clipboard. You could try adding a parent property to the class which is a TWinControl, the lowest level object in the VCL with a hWnd

Peter

Reply by email

Shane Miller
to Marc Weustink: + From: Hongli Lai + + GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. On second…

I have commited a few changes today.
SAVE PROJECT will work now. It's about 80% complete. It will work best when you create a new project via PROJECT - NEW PROJECT menu.

New Project will work. It creates a Project1.fpr and Unit1.pp file. It opens up ideeditor and adds a page for the Unit1.pp file. It extract info out of these files and adds them to a structure (defined in global.pp) called UnitList.
Unitlist contains the NAME, SOURCE, FILENAME, PAGE, and file type of each unit.

I am using the Project.pp file now in Main.pp. I use it to record a number of things in the .dsk file that's created when you do a SAVE PROJECT. I will create an example and commit it tomorrow. It works similiar to saving your desktop settings works in Delphi. It records which unit is being displayed, the location of the editor window, the location of the cursor in each visible source file, the location of the main window, etc. Works real well actually.

To test these features, run Lazarus and select Project NEW. then move the editor around somewhere and then select SAVE PROJECT. Pick a location. Don't save this into the LAzarus source directory!!! Close Lazarus. Run Lazarus again and select PROJECT - OPEN PROJECT. Select the .fpr file and it should (should!) load the unit and display it exactly where the editor was when you saved. If not, no big deal, I will be working out the bugs tomorrow.

Thanks
---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus

Earlier message 26 lines
----- Original Message ----- From: "Peter Dyson" To: Sent: Wednesday, March 01, 2000 9:14 PM Subject: Re: Linux Clipboard > > > > I don't understand this. According to the Win32 API docs, the first > parameter > > of OpenClipboard must be a HWND. > > What did you mean "OpenClipboard needs a window"? > > > > I usually use the forms hWnd when using the API clipboard. > You could try adding a parent property to the class which is > a TWinControl, the lowest level object in the VCL with a > hWnd > > Peter > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Shane Miller

.LPR would be fine with me. I am not real worried about the name of the file but I guess LPR would make more sense than FPR.

I am using the same format as Delphi 5 uses. It is an INI file. I am not using XML because it's not compatable with Delphi. Shane

>> 03/02/00 01:11AM >>>
Shane Miller wrote 8 lines
New Project will work. It creates a Project1.fpr and Unit1.pp file. It opens up ideeditor and adds a page for the Unit1.pp file. It extract info out of these files and adds them to a structure (defined in global.pp) called UnitList. Unitlist contains the NAME, SOURCE, FILENAME, PAGE, and file type of each unit.

I'm just wondering what you all think about naming the project files .lpr instead of .fpr since they are specific to Lazarus. FPC doesn't know or care anything about them. Probably doesn't really matter much. I was just pondering the idea and thought I would see what you all think about it.

Show quoted text 8 lines
I am using the Project.pp file now in Main.pp. I use it to record a number of things in the .dsk file that's created when you do a SAVE PROJECT. I will create an example and commit it tomorrow. It works similiar to saving your desktop settings works in Delphi. It records which unit is being displayed, the location of the editor window, the location of the cursor in each visible source file, the location of the main window, etc. Works real well actually.

What format are you using for the .dsk file? Are you using XML?

Show quoted text 9 lines
To test these features, run Lazarus and select Project NEW. then move the editor around somewhere and then select SAVE PROJECT. Pick a location. Don't save this into the LAzarus source directory!!! Close Lazarus. Run Lazarus again and select PROJECT - OPEN PROJECT. Select the .fpr file and it should (should!) load the unit and display it exactly where the editor was when you saved. If not, no big deal, I will be working out the bugs tomorrow.

Very cool. I will try it out.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

Currently here are the things you can do in the IDE.

Select Project New and it'll create a base project for you. Save it via Save Project.

You can add units to the project by selecting File Open and opening other .pp files. You can view the units in the project via the View - Units or View Forms dialog. I you want to create a NEW unit or form, select that under the FILE menu. It's create a unique UNIT name and FORM name based on what units are already in the project.

I have run into problems loading PROJECTS with many or large units. I will look into that but I think it's related to how long it takes to load the unit.

When you load a project, be patient. Drawing the mwEDIT component with the new text in it takes a bit of time right now.

When you select FILE SAVE it wil save the currently active unit in the notebook. There are a few bugs yet and I will fix them soon. At this point all I need is the compiler interfaced into lazarus via a Project build menu item and we could use it.

One bug I have found is that it doesn't highlight my code. Not sure why yet.

Shane

Reply by email

Hongli Lai
to Marc Weustink: + From: Hongli Lai + + GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. On second…
Show quoted text 16 lines
On second thoughts, if you want to do something with the clipboard in WINAPI, you need to open the clipboard first. OpenClipboard needs a window. There you have a GTKwindow you can work with for the other functions. And only one window can open the clipboard. If you implement the API functs: OpenClipboard CloseClipboard EmptyClipboard GetClipboardData SetClipboardData EnumClipboardFormats you then are on the way to implement TClipboard. Marc

I don't understand this. According to the Win32 API docs, the first parameter of OpenClipboard must be a HWND.
What did you mean "OpenClipboard needs a window"?

Reply by email

Peter Dyson
to Shane Miller: Currently here are the things you can do in the IDE. Select Project New and it'll create…
One bug I have found is that it doesn't highlight my code. Not sure why

yet.

Shane

The fix is in the new version going in but here is the code thats stops it from working

function TmwPasSyn.IdentKind(MayBe: PChar): TtkTokenKind;
var
  HashKey: Integer;
  {$IFDEF MWE_FPC}
  pF: TIdentFuncTableFunc;
  {$ENDIF}
begin
  fToIdent := MayBe;
  HashKey := KeyHash(MayBe);
  {$IFDEF MWE_FPC}
  if HashKey < 192 then
     begin
     pF := fIdentFuncTable[HashKey];
     Result := TtkTokenKind(pF);
     end
   else
     Result := tkIdentifier;
  {$ELSE}
  if HashKey < 192 then Result := fIdentFuncTable[HashKey] else Result :=
tkIdentifier;
  {$ENDIF}
end;

This was what was stopping the original code, but I have delphi and H+ in the new stuff, so IO don't know if this works in older version.

Peter

Reply by email

Curtis White
to Marc Weustink: + From: Hongli Lai + + GDK needs a GdkWindow. And GdkWindow needs a GtkWidget. On second…
Shane Miller wrote 8 lines
New Project will work. It creates a Project1.fpr and Unit1.pp file. It opens up ideeditor and adds a page for the Unit1.pp file. It extract info out of these files and adds them to a structure (defined in global.pp) called UnitList. Unitlist contains the NAME, SOURCE, FILENAME, PAGE, and file type of each unit.

I'm just wondering what you all think about naming the project files .lpr instead of .fpr since they are specific to Lazarus. FPC doesn't know or care anything about them. Probably doesn't really matter much. I was just pondering the idea and thought I would see what you all think about it.

Show quoted text 8 lines
I am using the Project.pp file now in Main.pp. I use it to record a number of things in the .dsk file that's created when you do a SAVE PROJECT. I will create an example and commit it tomorrow. It works similiar to saving your desktop settings works in Delphi. It records which unit is being displayed, the location of the editor window, the location of the cursor in each visible source file, the location of the main window, etc. Works real well actually.

What format are you using for the .dsk file? Are you using XML?

Show quoted text 9 lines
To test these features, run Lazarus and select Project NEW. then move the editor around somewhere and then select SAVE PROJECT. Pick a location. Don't save this into the LAzarus source directory!!! Close Lazarus. Run Lazarus again and select PROJECT - OPEN PROJECT. Select the .fpr file and it should (should!) load the unit and display it exactly where the editor was when you saved. If not, no big deal, I will be working out the bugs tomorrow.

Very cool. I will try it out.

Reply by email