NO

Author Topic: how to use resource editor  (Read 14877 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: how to use resource editor
« Reply #15 on: August 01, 2011, 08:14:20 PM »
In comctl32.dll resources
small bitmap 120
bigger bitmap 121
Code: [Select]
HBITMAP hBitmap = LoadBitmap(GetModuleHandle(TEXT("comctl32")), MAKEINTRESOURCE(120));
Bitmap from resource with 2 buttons
Code: [Select]
void FillToolbar(HWND hWndDlg, int iCtl)
{
TBBUTTON tbb[] = {
{0, IDM_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON},
{1, IDM_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON},
};
HWND hToolbar = GetDlgItem(hWndDlg, iCtl);
if (hToolbar) {
// Load the button images.
TBADDBITMAP tbBitmap;
tbBitmap.hInst = GetModuleHandle(NULL);
tbBitmap.nID = IDR_TOOLBAR1;
SendMessage(hToolbar, TB_ADDBITMAP, 2, (WPARAM)&tbBitmap);
//SendMessage(hToolbar, TB_LOADIMAGES, (WPARAM)IDB_STD_SMALL_COLOR, (LPARAM)HINST_COMMCTRL);
// Add buttons.
SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
SendMessage(hToolbar, TB_ADDBUTTONS, (WPARAM)NELEMS(tbb), (LPARAM)&tbb);
}
}
EDIT:
If need ToolTips insert TBSTYLE_TOOLTIPS|TBSTYLE_LIST to resource
and use this function:
Code: [Select]
void FillToolbar(HWND hWndDlg, int iCtl)
{
TBBUTTON tbb[] = {
{STD_FILENEW, IDM_NEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, (INT_PTR)"New"},
{STD_FILEOPEN, IDM_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0}, 0L, (INT_PTR)"Open"},
};
HWND hToolbar = GetDlgItem(hWndDlg, iCtl);
if (hToolbar) {
// Load the button images.
SendMessage(hToolbar, TB_LOADIMAGES, (WPARAM)IDB_STD_SMALL_COLOR, (LPARAM)HINST_COMMCTRL);
// Add buttons.
SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
SendMessage(hToolbar, TB_ADDBUTTONS, (WPARAM)NELEMS(tbb), (LPARAM)&tbb);
SendMessage(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
}
}
« Last Edit: August 03, 2011, 09:22:32 PM by timovjl »
May the source be with you

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: how to use resource editor
« Reply #16 on: August 01, 2011, 09:21:05 PM »
I think you should start at reading through the toolbar section at MSDN.
---
Stefan

Proud member of the UltraDefrag Development Team

jboyes

  • Guest
Re: how to use resource editor
« Reply #17 on: August 03, 2011, 10:17:13 PM »
Thank you once again Timovjl. This time, not only did you answer my question but you did so even without me having to ask it. I am very grateful for the 'tooltip' edit that you made to your original post.

The beauty of your program snippets is that they are concise and they tie in beautifully with the Pelles IDE.

I am a C programmer of old but recently have been using Visual Basic Express. The problem with VB is that the programs are messy to disseminate due to the .NET runtime. With Pelles C, the programs I write can be passed on simply and even run as 'no-install' applications.

Many thanks for your help.

John.

migf1

  • Guest
Re: how to use resource editor
« Reply #18 on: May 06, 2012, 12:13:12 PM »
An old topic, but I think there is no need for a new one.

I don't seem to find how to disable snapping when creating/moving controls let's say inside a dialog parent. They always get snapped to the grid.

I did a quick search on the net, the forum and the help files, but I don't seem to find what I'm looking for.

Is there a command to disable snapping in the Pelles C resource-editor?
« Last Edit: May 06, 2012, 12:15:06 PM by migf1 »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: how to use resource editor
« Reply #19 on: May 06, 2012, 12:45:37 PM »
Tools -> Options -> Dialog -> Use grid
May the source be with you

migf1

  • Guest
Re: how to use resource editor
« Reply #20 on: May 06, 2012, 12:57:40 PM »
Thank you!

PS. It would be useful if this could be also addressed with the use of any of the Alt/Ctr/Shift keys. Perhaps in a future version. Thanks again!

CommonTater

  • Guest
Re: how to use resource editor
« Reply #21 on: May 06, 2012, 04:23:20 PM »
Thank you!

PS. It would be useful if this could be also addressed with the use of any of the Alt/Ctr/Shift keys. Perhaps in a future version. Thanks again!


Tools -> Customize -> Keyboard -> Dialog

However the grid setting is global, if you enable it *all* controls will snap to their nearest gridline.




migf1

  • Guest
Re: how to use resource editor
« Reply #22 on: August 10, 2020, 04:31:57 PM »
Hello folks, loooooong time no see! Hope everyone is doing fine!

An ancient topic but I thought there is no need to start a new one. I just D/Led Pelles C v10.00.6 and playing a bit with the resource editor. I think the Properties dialog used to show brief hints for the selected property, at the bottom of the dialog. It has been removed or is it an option I can't find?

I mean this dialog: http://prntscr.com/tx7dd4 (shouldn't a brief hint about the selected "Group" property show at the bottom of the dialog)?
« Last Edit: August 10, 2020, 04:36:31 PM by migf1 »

Offline John Z

  • Member
  • *
  • Posts: 796
Re: how to use resource editor
« Reply #23 on: August 21, 2020, 01:03:41 PM »
I don't recall seeing that in Pelles C.  VB has it.

John Z